Kandra.EntityOperations
Kandra.EntityOperations.Adapters.ChangeTrackingDispatch
Shared "GetChangeState"/"GetHistory"/"GetPastState" dispatch for every adapter whose service implements IEntityCrudService (Dictionary, HierarchicalDictionary, Document) - these 3 operations (gap C07) come from the shared base interface, so the dispatch logic is identical regardless of kind; only the closed DTO/QUERY_DTO types differ.
Kandra.EntityOperations.Adapters.ConstantOperationAdapter
Dispatches tool-6's single, read-only "Get" operation for one Constant. Unlike every other adapter, this one is constructed inline by EntityOperationTools rather than resolved from a generator-emitted keyed DI registration - a constant's name is only known at call time (Constants are composed from the runtime IConstantRegistry, not discovered by Kandra.Generators.EntityOperations; see CompositeEntityCatalog), and constructing one just needs the already-injectable IConstantsService plus that name - no generic DTO type parameter to close over.
Constructors
| Constructor | Description |
|---|---|
ConstantOperationAdapter(IConstantsService, String) | Dispatches tool-6's single, read-only "Get" operation for one Constant. Unlike every other adapter, this one is constructed inline by EntityOperationTools rather than resolved from a generator-emitted keyed DI registration - a constant's name is only known at call time (Constants are composed from the runtime IConstantRegistry, not discovered by Kandra.Generators.EntityOperations; see CompositeEntityCatalog), and constructing one just needs the already-injectable IConstantsService plus that name - no generic DTO type parameter to close over. |
Kandra.EntityOperations.Adapters.DataProcessorOperationAdapter<T0, T1>
Dispatches tool-6's single "Execute" operation for one DataProcessor type onto its IDataProcessorService.
Constructors
| Constructor | Description |
|---|---|
DataProcessorOperationAdapter(IDataProcessorService<T0, T1>, JsonSerializerOptions) | Dispatches tool-6's single "Execute" operation for one DataProcessor type onto its IDataProcessorService. |
Kandra.EntityOperations.Adapters.DictionaryOperationAdapter<T0, T1>
Dispatches tool-6 operations for one flat Dictionary type onto its IDictionaryCrudService.
Constructors
| Constructor | Description |
|---|---|
DictionaryOperationAdapter(IDictionaryCrudService<T0, T1>, JsonSerializerOptions) | Dispatches tool-6 operations for one flat Dictionary type onto its IDictionaryCrudService. |
Kandra.EntityOperations.Adapters.DocumentOperationAdapter<T0, T1>
Dispatches tool-6 operations for one Document type onto its IDocumentCrudService.
Constructors
| Constructor | Description |
|---|---|
DocumentOperationAdapter(IDocumentCrudService<T0, T1>, JsonSerializerOptions) | Dispatches tool-6 operations for one Document type onto its IDocumentCrudService. |
Kandra.EntityOperations.Adapters.EntityJson
Payload (de)serialization shared by every IEntityOperationAdapter. Always goes through the caller-supplied JsonSerializerOptions (resolved from MVC's own JsonOptions - see KandraMcpServiceCollectionExtensions), so a tool-6 payload round-trips through exactly the same converters (camelCase enums, etc.) the generated REST controllers use for the same DTO.
Kandra.EntityOperations.Adapters.EntityOperationException
A caller-facing MCP tool error (bad kind/type/operation/payload). The MCP SDK turns an unhandled exception from a tool method into an isError tool result on its own, so no separate success/error envelope is needed on top of this.
Constructors
| Constructor | Description |
|---|---|
EntityOperationException(String) | A caller-facing MCP tool error (bad kind/type/operation/payload). The MCP SDK turns an unhandled exception from a tool method into an isError tool result on its own, so no separate success/error envelope is needed on top of this. |
Kandra.EntityOperations.Adapters.HierarchicalDictionaryOperationAdapter<T0, T1>
Dispatches tool-6 operations for one hierarchical Dictionary type onto its IHierarchicalDictionaryCrudService.
Constructors
| Constructor | Description |
|---|---|
HierarchicalDictionaryOperationAdapter(IHierarchicalDictionaryCrudService<T0, T1>, JsonSerializerOptions) | Dispatches tool-6 operations for one hierarchical Dictionary type onto its IHierarchicalDictionaryCrudService. |
Kandra.EntityOperations.Adapters.IEntityOperationAdapter
Non-generic dispatch seam execute_entity_operation (tool 6) calls into for one entity type. Document/Dictionary/Report/DataProcessor implementations are generic over their concrete DTO types (hand-written once in this namespace) and resolved per concrete entity via a keyed DI registration the generator emits ("{Kind}:{Name}") - see Kandra.Generators.EntityOperations. Constant's implementation is constructed inline by the tool instead, since a constant's name is only known at call time (see ConstantOperationAdapter's own doc comment).
Kandra.EntityOperations.Adapters.ReportOperationAdapter<T0, T1>
Dispatches tool-6's single "Run" operation for one Report type onto its IReportService.
Constructors
| Constructor | Description |
|---|---|
ReportOperationAdapter(IReportService<T0, T1>, JsonSerializerOptions) | Dispatches tool-6's single "Run" operation for one Report type onto its IReportService. |
Kandra.EntityOperations.Catalog.CompositeEntityCatalog
Merges the generated per-configuration catalog (Document/Dictionary/Report/DataProcessor/Enum, from Kandra.Generators.EntityOperations) with Constant entries derived here, at DI-registration time, from the already-registered IConstantRegistry. Constants are deliberately not discovered by the MCP generator itself - Kandra.Generators.Constants already owns that discovery, and re-walking the compilation for [KandraConstant] types here would just duplicate it. See AddKandraMcp<TCatalog> for how this is composed.
Kandra.EntityOperations.Catalog.EntityCatalogEntry
Everything the MCP tools need to know about one entity type, for either kind of consumer: the meta-tools (describe/list) and IEntityOperationAdapter dispatch (execute). Document/Dictionary/ Report/DataProcessor/Enum entries come from the generated per-configuration catalog (Kandra.Generators.EntityOperations); Constant entries are composed at DI-registration time from the already-registered IConstantRegistry - see CompositeEntityCatalog.
Constructors
| Constructor | Description |
|---|---|
EntityCatalogEntry(String, EntityKind, Type, Type, Type, Boolean) | Everything the MCP tools need to know about one entity type, for either kind of consumer: the meta-tools (describe/list) and IEntityOperationAdapter dispatch (execute). Document/Dictionary/ Report/DataProcessor/Enum entries come from the generated per-configuration catalog (Kandra.Generators.EntityOperations); Constant entries are composed at DI-registration time from the already-registered IConstantRegistry - see CompositeEntityCatalog. |
Properties
| Property | Description |
|---|---|
BehaviorType | The paired Behavior type (Document/Dictionary/Report/DataProcessor only) - null for Constant/Enum. Used to reflect [RegisterTransactions]/[AccountTransactions] off a Document's Behavior for describe_entity_type. |
DtoType | The entity's Dto type (Document/Dictionary/Report filters/DataProcessor input), the enum type (Enum kind), or the constant's descriptor type (Constant<T> subclass, Constant kind). |
IsHierarchical | True for a hierarchical Dictionary; always false otherwise. |
Kind | Which of the 6 in-scope kinds this entry belongs to. |
Name | The entity's [Kandra*Form(Name=...)]/constant name, e.g. "Waybill". |
QueryOrResultDtoType | The QueryDto (Document/Dictionary), ResultDto (Report/DataProcessor), or value type (Constant); null for Enum. |
Kandra.EntityOperations.Catalog.EntityKind
The entity kinds the MCP server's dynamic meta-tools operate over. Register is deliberately not a top-level kind here - a Document's own describe/execute surface already carries which registers/ledger it touches (see BehaviorType and the Document adapter's GetRegisterTransactions/GetAccountTransactions operations).
Kandra.EntityOperations.Catalog.HierarchicalDtoResolver
Resolves a hierarchical dictionary's concrete (non-folder) leaf Dto type from its abstract root - the same "read the non-folder [JsonDerivedType]" technique EntityRouteConventions.Resolve uses for routing. Shared because both EntityMetaTools (field metadata) and AccountingTools (subconto slot type cross-referencing) need it: a hierarchical entry's DtoType is the abstract root (e.g. CounterpartyNodeDto), which doesn't declare the leaf-only fields. (It does carry the dictionary's one [TypeId] - read that off the root directly, not via this resolver.)
Kandra.EntityOperations.Catalog.IEntityCatalog
Every entity type the MCP server can describe/operate on in this configuration - the runtime counterpart of Kandra.ClientLib.Common.TypeRegistry.ITypeRegistry, purpose-built for the MCP tools instead of client-side selector controls. The implementation covering Document/Dictionary/Report/DataProcessor/Enum is generated per-configuration by Kandra.Generators.EntityOperations; see CompositeEntityCatalog for how Constant entries are layered on top at runtime.
Kandra.EntityOperations.EntityJsonOptions
The engine's own JSON settings for entity payloads - the same ones MVC is configured with for the generated REST controllers (web defaults = camelCase + case-insensitive reads, camelCase string enums), so a payload round-trips identically whether it arrives over HTTP, MCP, an import package, a scheduler job or the setup wizard.
Kandra.EntityOperations.EntityOperationsServiceCollectionExtensions
Methods
| Method | Description |
|---|---|
AddKandraEntityOperations<T0>(IServiceCollection) | Wires the host-agnostic entity-operations layer: the entity catalog (the configuration's generated TCatalog plus constants from the already-registered IConstantRegistry), the field-metadata builder, the executor, and the engine-owned JsonSerializerOptions the generated adapters resolve (registered with TryAdd, so a host that already registered its own wins). A configuration also calls its generated AddGenerated{Config}EntityAdapters(). |
Kandra.EntityOperations.IEntityOperationExecutor
Host-agnostic entry point for "run operation X on entity type Y with this JSON payload": catalog lookup, adapter resolution and operation check in one place, shared by MCP and the data importer. Every operation goes through the real CRUD/report/processor service, so behaviors, validators, posting and the per-entity authorization checks run exactly as they do on the HTTP path.
Kandra.EntityOperations.Metadata.EntityFieldInfo
One Dto property's schema, as reported by describe_entity_type (tool 5). Caption is the short UI label ([Caption], resolved through localization); Description is the semantic explanation for an AI reader (System.ComponentModel.DescriptionAttribute, the same attribute the MCP SDK itself uses for tool/parameter descriptions) - the two serve different audiences and are deliberately both surfaced rather than one standing in for the other.
Constructors
| Constructor | Description |
|---|---|
EntityFieldInfo(String, String, Boolean, String, String, String, String, Boolean, Boolean, Nullable<Int32>, Boolean, IReadOnlyList<EntityFieldInfo>, String, Boolean) | One Dto property's schema, as reported by describe_entity_type (tool 5). Caption is the short UI label ([Caption], resolved through localization); Description is the semantic explanation for an AI reader (System.ComponentModel.DescriptionAttribute, the same attribute the MCP SDK itself uses for tool/parameter descriptions) - the two serve different audiences and are deliberately both surfaced rather than one standing in for the other. |
Kandra.EntityOperations.Metadata.EntityFieldMetadataBuilder
Runtime reflection over a Dto type's public properties, building the field schema describe_entity_type (tool 5) reports. Deliberately plain runtime reflection, not generator output: the Roslyn-side UiFieldDiscovery (Kandra.Generators.Shared) that does similar per-field work for the Blazor UI generator operates on compile-time ISymbols and can't be called from here - only its conventions (which attribute maps to which editor kind, etc.) are ported, not its code.
Constructors
| Constructor | Description |
|---|---|
EntityFieldMetadataBuilder(IStringLocalizer, IEntityCatalog) | Runtime reflection over a Dto type's public properties, building the field schema describe_entity_type (tool 5) reports. Deliberately plain runtime reflection, not generator output: the Roslyn-side UiFieldDiscovery (Kandra.Generators.Shared) that does similar per-field work for the Blazor UI generator operates on compile-time ISymbols and can't be called from here - only its conventions (which attribute maps to which editor kind, etc.) are ported, not its code. |
Methods
| Method | Description |
|---|---|
ResolveDescription(Type) | The semantic explanation for an entity Dto class, if any - see ResolveDescription. |