# EntityManager Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Business/EntityManager Provides a base class for entity-specific business logic managers with built-in CRUD operations, audit trail support, and lifecycle event hooks. Handles comm... ## Definition **Assembly:** CloudNimble.EasyAF.Business.EF6.dll **Namespace:** CloudNimble.EasyAF.Business **Inheritance:** CloudNimble.EasyAF.Business.ManagerBase\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Business.EntityManager ``` ## Summary Provides a base class for entity-specific business logic managers with built-in CRUD operations, audit trail support, and lifecycle event hooks. Handles common entity operations and automatically manages audit fields for entities that implement auditing interfaces. ## Remarks This manager provides comprehensive entity lifecycle management including: * Automatic audit trail creation for entities implementing [ICreatedAuditable](/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable), [IUpdatedAuditable](/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable) * User tracking for entities implementing `ICreatorTrackable`1`, `IUpdaterTrackable`1` * Virtual hooks for custom business logic before and after CRUD operations * Batch operations support for improved performance * Allocation-free audit field population using direct interface type checks (Guid IDs checked first) ## Type Parameters * `TContext` - The type of DbContext used for database operations. * `TEntity` - The type of entity managed by this manager. ## Examples ```csharp theme={"dark"} public class UserManager : EntityManager<MyDbContext, User> { public UserManager(MyDbContext context, IMessagePublisher publisher) : base(context, publisher) { } public override async Task OnInsertingAsync(User entity) { await base.OnInsertingAsync(entity); // Handles audit fields entity.IsActive = true; // Custom business logic } public override async Task<bool> OnInsertedAsync(User entity) { await MessagePublisher.PublishAsync(new UserCreatedEvent { UserId = entity.Id }); return await base.OnInsertedAsync(entity); } } ``` ## Constructors ### .ctor Initializes a new instance of the `EntityManager`2\` class. #### Syntax ```csharp theme={"dark"} public EntityManager(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Initializes a new instance of the `ManagerBase`1\` class. #### Syntax ```csharp theme={"dark"} public ManagerBase(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DataContext Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the database context instance used for data operations. This context is injected through the constructor and provides access to the database. #### Syntax ```csharp theme={"dark"} public TContext DataContext { get; private set; } ``` #### Property Value Type: `TContext` ### MessagePublisher Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the message publisher instance used for publishing events and messages to the message bus. This publisher is injected through the constructor and enables event-driven architecture patterns. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Publish.IMessagePublisher MessagePublisher { get; private set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` ## Methods ### DeleteAsync Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks RWM: This will need to be Deleted to be generic if it's going to be in a NuGet package. ### DeleteAsync Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DirectDelete Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public int DirectDelete(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectDeleteAsync Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectDeleteAsync(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectUpdate Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public int DirectUpdate(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### DirectUpdateAsync Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectUpdateAsync(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### InsertAsync Inserts a single entity into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inserts a single entity into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. ### InsertAsync Inserts a collection of entities into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inserts a collection of entities into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnDeletedAsync Virtual Called after successfully deleting an entity from the database. Use this method for post-deletion business logic such as cleanup operations, sending notifications, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was deleted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-deletion processing was successful; otherwise, false. ### OnDeletedAsync Virtual Called after successfully deleting a collection of entities from the database. Applies OnDeletedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Virtual Called before deleting an entity from the database. Override this method to add custom business logic or validation before deletion. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Virtual Called before deleting a collection of entities from the database. Applies OnDeletingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertedAsync Virtual Called after successfully inserting an entity into the database. Use this method for post-insertion business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was inserted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-insertion processing was successful; otherwise, false. ### OnInsertedAsync Virtual Called after successfully inserting a collection of entities into the database. Applies OnInsertedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertingAsync Virtual Called before inserting an entity into the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * CreatedById for entities implementing `ICreatorTrackable`1\` * DateCreated for entities implementing [ICreatedAuditable](/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable) Override this method to add custom business logic before insertion. ### OnInsertingAsync Called before inserting a collection of entities into the database. Applies OnInsertingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnInsertingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatedAsync Virtual Called after successfully updating an entity in the database. Use this method for post-update business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was updated. | #### Returns Type: `System.Threading.Tasks.Task` True if post-update processing was successful; otherwise, false. ### OnUpdatedAsync Virtual Called after successfully updating a collection of entities in the database. Applies OnUpdatedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were updated. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatingAsync Virtual Called before updating an entity in the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * UpdatedById for entities implementing `IUpdaterTrackable`1\` * DateUpdated for entities implementing [IUpdatedAuditable](/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable) Override this method to add custom business logic before updating. ### OnUpdatingAsync Virtual Called before updating a collection of entities in the database. Applies OnUpdatingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | #### Returns Type: `System.Threading.Tasks.Task` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ResetAuditProperties Resets audit properties to an "Inserted" state by setting creation fields and clearing update fields. Sets CreatedById and DateCreated to current values, while clearing UpdatedById and DateUpdated. #### Syntax ```csharp theme={"dark"} public void ResetAuditProperties(TDbObservable entity) where TDbObservable : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TDbObservable` | The entity whose audit properties should be reset. | #### Type Parameters * `TDbObservable` - Any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) in the object model. DOES NOT have to be the entity for this Manager. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### UpdateAsync Updates a single entity in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Updates a single entity in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. ### UpdateAsync Updates a collection of entities in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Updates a collection of entities in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. # IdentifiableEntityManager Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Business/IdentifiableEntityManager Provides a specialized entity manager for entities that implement IIdentifiable<TId>. Automatically generates GUID identifiers for entities with empty ... ## Definition **Assembly:** CloudNimble.EasyAF.Business.EF6.dll **Namespace:** CloudNimble.EasyAF.Business **Inheritance:** CloudNimble.EasyAF.Business.EntityManager\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Business.IdentifiableEntityManager ``` ## Summary Provides a specialized entity manager for entities that implement IIdentifiable\. Automatically generates GUID identifiers for entities with empty IDs during insertion. ## Type Parameters * `TContext` - The [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext) type to use for this Manager. * `TEntity` - The entity type for this Manager. * `TId` - The data type of the Id column for this Entity. ## Constructors ### .ctor Create a new instance of the given Manager for a given [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public IdentifiableEntityManager(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext) instance to use for the database connection. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The SimpleMessageBus `IMessagePublisher` instance to use to publish Messages to a Queue. Should be injected by the DI container. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Initializes a new instance of the `EntityManager`2\` class. #### Syntax ```csharp theme={"dark"} public EntityManager(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Initializes a new instance of the `ManagerBase`1\` class. #### Syntax ```csharp theme={"dark"} public ManagerBase(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DataContext Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the database context instance used for data operations. This context is injected through the constructor and provides access to the database. #### Syntax ```csharp theme={"dark"} public TContext DataContext { get; private set; } ``` #### Property Value Type: `TContext` ### MessagePublisher Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the message publisher instance used for publishing events and messages to the message bus. This publisher is injected through the constructor and enables event-driven architecture patterns. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Publish.IMessagePublisher MessagePublisher { get; private set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` ## Methods ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks RWM: This will need to be Deleted to be generic if it's going to be in a NuGet package. ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DirectDelete Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public int DirectDelete(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectDeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectDeleteAsync(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectUpdate Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public int DirectUpdate(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### DirectUpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectUpdateAsync(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a single entity into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a single entity into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a collection of entities into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a collection of entities into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnDeletedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully deleting an entity from the database. Use this method for post-deletion business logic such as cleanup operations, sending notifications, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was deleted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-deletion processing was successful; otherwise, false. ### OnDeletedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully deleting a collection of entities from the database. Applies OnDeletedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before deleting an entity from the database. Override this method to add custom business logic or validation before deletion. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before deleting a collection of entities from the database. Applies OnDeletingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully inserting an entity into the database. Use this method for post-insertion business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was inserted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-insertion processing was successful; otherwise, false. ### OnInsertedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully inserting a collection of entities into the database. Applies OnInsertedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertingAsync Override Perform business logic (like setting the entity's Id) prior to saving the *TEntity* to the *TContext*. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task OnInsertingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The *TEntity* to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before inserting an entity into the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * CreatedById for entities implementing `ICreatorTrackable`1\` * DateCreated for entities implementing [ICreatedAuditable](/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable) Override this method to add custom business logic before insertion. ### OnInsertingAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before inserting a collection of entities into the database. Applies OnInsertingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnInsertingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully updating an entity in the database. Use this method for post-update business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was updated. | #### Returns Type: `System.Threading.Tasks.Task` True if post-update processing was successful; otherwise, false. ### OnUpdatedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully updating a collection of entities in the database. Applies OnUpdatedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were updated. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before updating an entity in the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * UpdatedById for entities implementing `IUpdaterTrackable`1\` * DateUpdated for entities implementing [IUpdatedAuditable](/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable) Override this method to add custom business logic before updating. ### OnUpdatingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before updating a collection of entities in the database. Applies OnUpdatingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | #### Returns Type: `System.Threading.Tasks.Task` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ResetAuditProperties Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Resets audit properties to an "Inserted" state by setting creation fields and clearing update fields. Sets CreatedById and DateCreated to current values, while clearing UpdatedById and DateUpdated. #### Syntax ```csharp theme={"dark"} public void ResetAuditProperties(TDbObservable entity) where TDbObservable : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TDbObservable` | The entity whose audit properties should be reset. | #### Type Parameters * `TDbObservable` - Any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) in the object model. DOES NOT have to be the entity for this Manager. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a single entity in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a single entity in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a collection of entities in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a collection of entities in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. # ManagerBase Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Business/ManagerBase Represents the base class for all EasyAF business logic managers. Provides access to a database context and message publishing capabilities for implementing ... ## Definition **Assembly:** CloudNimble.EasyAF.Business.EF6.dll **Namespace:** CloudNimble.EasyAF.Business **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Business.ManagerBase ``` ## Summary Represents the base class for all EasyAF business logic managers. Provides access to a database context and message publishing capabilities for implementing business operations and workflows. ## Remarks This base class is designed to encapsulate business logic that requires database access and messaging capabilities. It's particularly useful for implementing complex business processes such as user registration, order processing, or any workflow that needs to coordinate database operations with message publishing for event-driven architectures. ## Type Parameters * `TContext` - The type of the database context (DbContext) used for data operations. ## Examples ```csharp theme={"dark"} public class UserRegistrationManager : ManagerBase<MyDbContext> { public UserRegistrationManager(MyDbContext context, IMessagePublisher publisher) : base(context, publisher) { } public async Task<User> RegisterUserAsync(string email, string password) { var user = new User { Email = email, Password = HashPassword(password) }; DataContext.Users.Add(user); await DataContext.SaveChangesAsync(); await MessagePublisher.PublishAsync(new UserRegisteredEvent { UserId = user.Id }); return user; } } ``` ## Constructors ### .ctor Initializes a new instance of the `ManagerBase`1\` class. #### Syntax ```csharp theme={"dark"} public ManagerBase(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DataContext Gets the database context instance used for data operations. This context is injected through the constructor and provides access to the database. #### Syntax ```csharp theme={"dark"} public TContext DataContext { get; private set; } ``` #### Property Value Type: `TContext` ### MessagePublisher Gets the message publisher instance used for publishing events and messages to the message bus. This publisher is injected through the constructor and enables event-driven architecture patterns. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Publish.IMessagePublisher MessagePublisher { get; private set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # StateMachineEntityManager Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Business/StateMachineEntityManager A Manager inheriting from `IdentifiableEntityManager`3` that contains reusable logic for updating a *TEntity*'s current State. ## Definition **Assembly:** CloudNimble.EasyAF.Business.EF6.dll **Namespace:** CloudNimble.EasyAF.Business **Inheritance:** CloudNimble.EasyAF.Business.IdentifiableEntityManager\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Business.StateMachineEntityManager ``` ## Summary A Manager inheriting from `IdentifiableEntityManager`3\` that contains reusable logic for updating a *TEntity*'s current State. ## Type Parameters * `TContext` - * `TEntity` - * `TId` - * `TStateType` - ## Constructors ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.IdentifiableEntityManager` Create a new instance of the given Manager for a given [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public IdentifiableEntityManager(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext) instance to use for the database connection. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The SimpleMessageBus `IMessagePublisher` instance to use to publish Messages to a Queue. Should be injected by the DI container. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Initializes a new instance of the `EntityManager`2\` class. #### Syntax ```csharp theme={"dark"} public EntityManager(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Initializes a new instance of the `ManagerBase`1\` class. #### Syntax ```csharp theme={"dark"} public ManagerBase(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DataContext Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the database context instance used for data operations. This context is injected through the constructor and provides access to the database. #### Syntax ```csharp theme={"dark"} public TContext DataContext { get; private set; } ``` #### Property Value Type: `TContext` ### MessagePublisher Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the message publisher instance used for publishing events and messages to the message bus. This publisher is injected through the constructor and enables event-driven architecture patterns. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Publish.IMessagePublisher MessagePublisher { get; private set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` ### StateTypes Gets the collection of active state types available for entities managed by this manager. This collection is populated during initialization from the database. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List StateTypes { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` ## Methods ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks RWM: This will need to be Deleted to be generic if it's going to be in a NuGet package. ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DirectDelete Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public int DirectDelete(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectDeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectDeleteAsync(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectUpdate Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public int DirectUpdate(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### DirectUpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectUpdateAsync(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Initialize Virtual Initializes the StateTypes collection by loading active state types from the database. This method is called automatically by state update methods if the collection is empty. #### Syntax ```csharp theme={"dark"} public virtual void Initialize() ``` ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a single entity into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a single entity into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a collection of entities into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a collection of entities into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnDeletedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully deleting an entity from the database. Use this method for post-deletion business logic such as cleanup operations, sending notifications, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was deleted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-deletion processing was successful; otherwise, false. ### OnDeletedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully deleting a collection of entities from the database. Applies OnDeletedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before deleting an entity from the database. Override this method to add custom business logic or validation before deletion. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before deleting a collection of entities from the database. Applies OnDeletingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully inserting an entity into the database. Use this method for post-insertion business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was inserted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-insertion processing was successful; otherwise, false. ### OnInsertedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully inserting a collection of entities into the database. Applies OnInsertedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertingAsync Override Inherited from `CloudNimble.EasyAF.Business.IdentifiableEntityManager` Perform business logic (like setting the entity's Id) prior to saving the *TEntity* to the *TContext*. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task OnInsertingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The *TEntity* to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before inserting an entity into the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * CreatedById for entities implementing `ICreatorTrackable`1\` * DateCreated for entities implementing [ICreatedAuditable](/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable) Override this method to add custom business logic before insertion. ### OnInsertingAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before inserting a collection of entities into the database. Applies OnInsertingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnInsertingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully updating an entity in the database. Use this method for post-update business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was updated. | #### Returns Type: `System.Threading.Tasks.Task` True if post-update processing was successful; otherwise, false. ### OnUpdatedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully updating a collection of entities in the database. Applies OnUpdatedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were updated. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before updating an entity in the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * UpdatedById for entities implementing `IUpdaterTrackable`1\` * DateUpdated for entities implementing [IUpdatedAuditable](/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable) Override this method to add custom business logic before updating. ### OnUpdatingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before updating a collection of entities in the database. Applies OnUpdatingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | #### Returns Type: `System.Threading.Tasks.Task` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ResetAuditProperties Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Resets audit properties to an "Inserted" state by setting creation fields and clearing update fields. Sets CreatedById and DateCreated to current values, while clearing UpdatedById and DateUpdated. #### Syntax ```csharp theme={"dark"} public void ResetAuditProperties(TDbObservable entity) where TDbObservable : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TDbObservable` | The entity whose audit properties should be reset. | #### Type Parameters * `TDbObservable` - Any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) in the object model. DOES NOT have to be the entity for this Manager. ### SetCancelledAsync Virtual Sets the entity's state to "Cancelled" (sort order 98). #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task SetCancelledAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to update. | #### Returns Type: `System.Threading.Tasks.Task` True if the state was successfully updated; otherwise, false. ### SetCompletedAsync Virtual Sets the entity's state to "Completed" (sort order 100). #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task SetCompletedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to update. | #### Returns Type: `System.Threading.Tasks.Task` True if the state was successfully updated; otherwise, false. ### SetCreatedAsync Sets the entity's state to "Created" (sort order 0). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task SetCreatedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to update. | #### Returns Type: `System.Threading.Tasks.Task` True if the state was successfully updated; otherwise, false. ### SetFailedAsync Virtual Sets the entity's state to "Failed" (sort order 99). #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task SetFailedAsync(TEntity entity, string errorMessage = "", string errorDetail = "") ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to update. | | `errorMessage` | `string` | Optional error message (currently not used in implementation). | | `errorDetail` | `string` | Optional error detail (currently not used in implementation). | #### Returns Type: `System.Threading.Tasks.Task` True if the state was successfully updated; otherwise, false. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a single entity in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a single entity in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a collection of entities in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a collection of entities in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. ### UpdateStateAsync Updates the entity's state to the state type with the specified sort order. Logs the state transition for tracking purposes. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateStateAsync(TEntity entity, int sortOrder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to update. | | `sortOrder` | `int` | The sort order of the target state type. | #### Returns Type: `System.Threading.Tasks.Task` True if the state was successfully updated; otherwise, false. #### Exceptions | Exception | Description | | - | - | | `Exception` | Thrown when no state type is found with the specified sort order. | # StatusEntityManager Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Business/StatusEntityManager A Manager inheriting from `IdentifiableEntityManager`3` that contains reusable logic for updating a *TEntity*'s current Status. ## Definition **Assembly:** CloudNimble.EasyAF.Business.EF6.dll **Namespace:** CloudNimble.EasyAF.Business **Inheritance:** CloudNimble.EasyAF.Business.IdentifiableEntityManager\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Business.StatusEntityManager ``` ## Summary A Manager inheriting from `IdentifiableEntityManager`3\` that contains reusable logic for updating a *TEntity*'s current Status. ## Type Parameters * `TContext` - * `TEntity` - * `TId` - * `TStatusType` - ## Constructors ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.IdentifiableEntityManager` Create a new instance of the given Manager for a given [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public IdentifiableEntityManager(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext) instance to use for the database connection. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The SimpleMessageBus `IMessagePublisher` instance to use to publish Messages to a Queue. Should be injected by the DI container. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Initializes a new instance of the `EntityManager`2\` class. #### Syntax ```csharp theme={"dark"} public EntityManager(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Initializes a new instance of the `ManagerBase`1\` class. #### Syntax ```csharp theme={"dark"} public ManagerBase(TContext dataContext, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataContext` | `TContext` | The database context instance for data operations. Should be injected by the DI container. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The message publisher instance for publishing events. Should be injected by the DI container. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DataContext Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the database context instance used for data operations. This context is injected through the constructor and provides access to the database. #### Syntax ```csharp theme={"dark"} public TContext DataContext { get; private set; } ``` #### Property Value Type: `TContext` ### MessagePublisher Inherited Inherited from `CloudNimble.EasyAF.Business.ManagerBase` Gets the message publisher instance used for publishing events and messages to the message bus. This publisher is injected through the constructor and enables event-driven architecture patterns. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Publish.IMessagePublisher MessagePublisher { get; private set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` ### StatusTypes Gets the collection of active status types available for entities managed by this manager. This collection is populated during initialization from the database. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List StatusTypes { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` ## Methods ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete a specific [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks RWM: This will need to be Deleted to be generic if it's going to be in a NuGet package. ### DeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete all [DbSet\`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) from a list with optional save operation using a specified [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | - | | `context` | `TContext` | - | | `save` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DirectDelete Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public int DirectDelete(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectDeleteAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Delete entities returned by the specified query without individual entity processing. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectDeleteAsync(System.Linq.Expressions.Expression> predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of deleting a set of data without loading entities in the context but none of the extra processing provided by OnDeleting / OnDeleted. ### DirectUpdate Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public int DirectUpdate(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `int` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### DirectUpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Executes a direct UPDATE query on the database without returning objects or processing them through the interceptors. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DirectUpdateAsync(System.Linq.Expressions.Expression> predicate, System.Linq.Expressions.Expression> updateExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `predicate` | `System.Linq.Expressions.Expression>` | An [Expression`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet`1](https://learn.microsoft.com/dotnet/api/system.data.entity.dbset-1) | | `updateExpression` | `System.Linq.Expressions.Expression>` | An [Expression\`1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) defining the updates to be performed on the records returned by the predicate. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This overload will give you all of the performance of updating a set of data without loading entities in the context but none of the extra processing provided by OnUpdating / OnUpdated. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Initialize Virtual Initializes the StatusTypes collection by loading active status types from the database. This method is called automatically by status update methods if the collection is empty. #### Syntax ```csharp theme={"dark"} public virtual void Initialize() ``` ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a single entity into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a single entity into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully inserted; otherwise, false. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a collection of entities into the database with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### InsertAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Inserts a collection of entities into the database using a specified context with optional save operation. Executes the OnInsertingAsync and OnInsertedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InsertAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully inserted; otherwise, false. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnDeletedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully deleting an entity from the database. Use this method for post-deletion business logic such as cleanup operations, sending notifications, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was deleted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-deletion processing was successful; otherwise, false. ### OnDeletedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully deleting a collection of entities from the database. Applies OnDeletedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before deleting an entity from the database. Override this method to add custom business logic or validation before deletion. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnDeletingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before deleting a collection of entities from the database. Applies OnDeletingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnDeletingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be deleted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully inserting an entity into the database. Use this method for post-insertion business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was inserted. | #### Returns Type: `System.Threading.Tasks.Task` True if post-insertion processing was successful; otherwise, false. ### OnInsertedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully inserting a collection of entities into the database. Applies OnInsertedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertingAsync Override Inherited from `CloudNimble.EasyAF.Business.IdentifiableEntityManager` Perform business logic (like setting the entity's Id) prior to saving the *TEntity* to the *TContext*. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task OnInsertingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The *TEntity* to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnInsertingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before inserting an entity into the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnInsertingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * CreatedById for entities implementing `ICreatorTrackable`1\` * DateCreated for entities implementing [ICreatedAuditable](/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable) Override this method to add custom business logic before insertion. ### OnInsertingAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before inserting a collection of entities into the database. Applies OnInsertingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnInsertingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be inserted. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully updating an entity in the database. Use this method for post-update business logic such as sending notifications, publishing events, or triggering external systems. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity that was updated. | #### Returns Type: `System.Threading.Tasks.Task` True if post-update processing was successful; otherwise, false. ### OnUpdatedAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called after successfully updating a collection of entities in the database. Applies OnUpdatedAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatedAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities that were updated. | #### Returns Type: `System.Threading.Tasks.Task` ### OnUpdatingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before updating an entity in the database. Automatically handles audit field population and user tracking for entities implementing the appropriate interfaces. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method automatically sets: * UpdatedById for entities implementing `IUpdaterTrackable`1\` * DateUpdated for entities implementing [IUpdatedAuditable](/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable) Override this method to add custom business logic before updating. ### OnUpdatingAsync Inherited Virtual Inherited from `CloudNimble.EasyAF.Business.EntityManager` Called before updating a collection of entities in the database. Applies OnUpdatingAsync logic to each entity in the collection. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task OnUpdatingAsync(System.Collections.Generic.List entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | #### Returns Type: `System.Threading.Tasks.Task` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ResetAuditProperties Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Resets audit properties to an "Inserted" state by setting creation fields and clearing update fields. Sets CreatedById and DateCreated to current values, while clearing UpdatedById and DateUpdated. #### Syntax ```csharp theme={"dark"} public void ResetAuditProperties(TDbObservable entity) where TDbObservable : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TDbObservable` | The entity whose audit properties should be reset. | #### Type Parameters * `TDbObservable` - Any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) in the object model. DOES NOT have to be the entity for this Manager. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a single entity in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a single entity in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entity was successfully updated; otherwise, false. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a collection of entities in the database with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. #### Remarks RWM: This will need to be updated to be generic if it's going to be in a NuGet package. ### UpdateAsync Inherited Inherited from `CloudNimble.EasyAF.Business.EntityManager` Updates a collection of entities in the database using a specified context with optional save operation. Executes the OnUpdatingAsync and OnUpdatedAsync lifecycle hooks for each entity. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(System.Collections.Generic.List entities, TContext context, bool save = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.List` | The collection of entities to be updated. | | `context` | `TContext` | The database context to use for the operation. | | `save` | `bool` | Whether to immediately save changes to the database. Defaults to true. | #### Returns Type: `System.Threading.Tasks.Task` True if the entities were successfully updated; otherwise, false. ### UpdateStatusAsync Updates the entity's status to the status type with the specified sort order. Logs the status transition for tracking purposes. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateStatusAsync(TEntity entity, int sortOrder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to update. | | `sortOrder` | `int` | The sort order of the target status type. | #### Returns Type: `System.Threading.Tasks.Task` True if the status was successfully updated; otherwise, false. #### Exceptions | Exception | Description | | - | - | | `Exception` | Thrown when no status type is found with the specified sort order. | # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Business/index Summary of the CloudNimble.EasyAF.Business Namespace ## Types ### Classes | Name | Summary | | - | - | | [EntityManager](/api-reference/CloudNimble/EasyAF/Business/EntityManager) | Provides a base class for entity-specific business logic managers with built-in CRUD operations, audit trail support, and lifecycle event hooks. Handles common entity operations and automatically manages audit fields for entities that implement auditing interfaces. | | [IdentifiableEntityManager](/api-reference/CloudNimble/EasyAF/Business/IdentifiableEntityManager) | Provides a specialized entity manager for entities that implement IIdentifiable\. Automatically generates GUID identifiers for entities with empty IDs during insertion. | | [ManagerBase](/api-reference/CloudNimble/EasyAF/Business/ManagerBase) | Represents the base class for all EasyAF business logic managers. Provides access to a database context and message publishing capabilities for implementing business operations and workflows. | | [StateMachineEntityManager](/api-reference/CloudNimble/EasyAF/Business/StateMachineEntityManager) | A Manager inheriting from `IdentifiableEntityManager`3\` that contains reusable logic for updating a *TEntity*'s current State. | | [StatusEntityManager](/api-reference/CloudNimble/EasyAF/Business/StatusEntityManager) | A Manager inheriting from `IdentifiableEntityManager`3\` that contains reusable logic for updating a *TEntity*'s current Status. | # ConfigurationBase Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase A base class implementation of the configuration your Blazor app will pull from wwwroot/appsettings.json. Provides standard HttpClient configuration for API ... ## Definition **Assembly:** CloudNimble.EasyAF.Configuration.dll **Namespace:** CloudNimble.EasyAF.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Configuration.ConfigurationBase ``` ## Summary A base class implementation of the configuration your Blazor app will pull from wwwroot/appsettings.json. Provides standard HttpClient configuration for API and application endpoints. ## Remarks This configuration class is typically used for customer-facing applications that need to communicate with external APIs and handle application-level HTTP requests. For administrative applications, consider using [ConfigurationPlusAdminBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationPlusAdminBase) instead. ## Examples ```csharp theme={"dark"} // In Program.cs or Startup.cs builder.Services.AddConfigurationBase<MyAppConfiguration>(builder.Configuration, "AppSettings"); // Example configuration in appsettings.json { "AppSettings": { "ApiRoot": "https://api.mycompany.com", "AppRoot": "https://myapp.mycompany.com", "HttpHandlerMode": "Add" } } // Usage in components [Inject] public MyAppConfiguration Config { get; set; } private async Task CallApi() { var httpClient = HttpClientFactory.CreateClient(Config.ApiClientName); var response = await httpClient.GetAsync($"{Config.ApiRoot}/api/data"); } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ConfigurationBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ApiClientName The name of the HttpClient that will be used to hit the app's Public API. #### Syntax ```csharp theme={"dark"} public string ApiClientName { get; set; } ``` #### Property Value Type: `string` ### ApiRoot The root of the API that your Blazor app will call. #### Syntax ```csharp theme={"dark"} public string ApiRoot { get; set; } ``` #### Property Value Type: `string` #### Remarks Most Blazor apps will call at least one API. If you need to call more than one, just inherit from ConfigurationBase and add your own properties. ### AppClientName The name of the HttpClient that will be used to hit the Blazor App's Controllers. #### Syntax ```csharp theme={"dark"} public string AppClientName { get; set; } ``` #### Property Value Type: `string` ### AppRoot The website your Blazor app is being served from. #### Syntax ```csharp theme={"dark"} public string AppRoot { get; set; } ``` #### Property Value Type: `string` #### Remarks Sometimes you will need to get information about the app's deployment before it has been fully-initialized in Program.cs. This is the place to do it. ### HttpHandlerMode Determines how HttpClient message handlers are configured when registering HTTP clients. Controls whether handlers are added to existing handlers or replace them entirely. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Core.HttpHandlerMode HttpHandlerMode { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Core.HttpHandlerMode` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ConfigurationPlusAdminBase Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationPlusAdminBase An extended configuration class that includes both public and administrative endpoint configuration. Inherits from [ConfigurationBase](/api-reference/CloudNi... ## Definition **Assembly:** CloudNimble.EasyAF.Configuration.dll **Namespace:** CloudNimble.EasyAF.Configuration **Inheritance:** CloudNimble.EasyAF.Configuration.ConfigurationBase ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Configuration.ConfigurationPlusAdminBase ``` ## Summary An extended configuration class that includes both public and administrative endpoint configuration. Inherits from [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase) and adds support for administrative APIs and applications. ## Remarks This configuration class should be used for applications that need both customer-facing and administrative functionality, such as multi-tenant applications with separate admin interfaces or applications that need to communicate with both public and private APIs. ## Examples ```csharp theme={"dark"} // In Program.cs or Startup.cs builder.Services.AddConfigurationBase<MyAdminConfiguration>(builder.Configuration, "AppSettings"); // Example configuration in appsettings.json { "AppSettings": { "ApiRoot": "https://api.mycompany.com", "AppRoot": "https://myapp.mycompany.com", "AdminApiRoot": "https://admin-api.mycompany.com", "AdminAppRoot": "https://admin.mycompany.com", "HttpHandlerMode": "Add" } } // Usage in administrative components [Inject] public MyAdminConfiguration Config { get; set; } private async Task CallAdminApi() { var adminClient = HttpClientFactory.CreateClient(Config.AdminApiClientName); var response = await adminClient.GetAsync($"{Config.AdminApiRoot}/admin/users"); } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ConfigurationPlusAdminBase() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Configuration.ConfigurationBase` #### Syntax ```csharp theme={"dark"} public ConfigurationBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdminApiClientName The name of the HttpClient that will be used to hit the Admin (Private) API. #### Syntax ```csharp theme={"dark"} public string AdminApiClientName { get; set; } ``` #### Property Value Type: `string` ### AdminApiRoot The root of the Admin (Private) API. #### Syntax ```csharp theme={"dark"} public string AdminApiRoot { get; set; } ``` #### Property Value Type: `string` #### Remarks Most Blazor apps will call at least one API. If you need to call more than one, just inherit from ConfigurationBase and add your own properties. ### AdminAppClientName The name of the HttpClient that will be used to hit the Admin Blazor Controllers. #### Syntax ```csharp theme={"dark"} public string AdminAppClientName { get; set; } ``` #### Property Value Type: `string` ### AdminAppRoot The website your Administrative Blazor app is being served from. #### Syntax ```csharp theme={"dark"} public string AdminAppRoot { get; set; } ``` #### Property Value Type: `string` #### Remarks Sometimes you will need to get information about the app's deployment before it has been fully-initialized in Program.cs. This is the place to do it. ### ApiClientName Inherited Inherited from `CloudNimble.EasyAF.Configuration.ConfigurationBase` The name of the HttpClient that will be used to hit the app's Public API. #### Syntax ```csharp theme={"dark"} public string ApiClientName { get; set; } ``` #### Property Value Type: `string` ### ApiRoot Inherited Inherited from `CloudNimble.EasyAF.Configuration.ConfigurationBase` The root of the API that your Blazor app will call. #### Syntax ```csharp theme={"dark"} public string ApiRoot { get; set; } ``` #### Property Value Type: `string` #### Remarks Most Blazor apps will call at least one API. If you need to call more than one, just inherit from ConfigurationBase and add your own properties. ### AppClientName Inherited Inherited from `CloudNimble.EasyAF.Configuration.ConfigurationBase` The name of the HttpClient that will be used to hit the Blazor App's Controllers. #### Syntax ```csharp theme={"dark"} public string AppClientName { get; set; } ``` #### Property Value Type: `string` ### AppRoot Inherited Inherited from `CloudNimble.EasyAF.Configuration.ConfigurationBase` The website your Blazor app is being served from. #### Syntax ```csharp theme={"dark"} public string AppRoot { get; set; } ``` #### Property Value Type: `string` #### Remarks Sometimes you will need to get information about the app's deployment before it has been fully-initialized in Program.cs. This is the place to do it. ### HttpHandlerMode Inherited Inherited from `CloudNimble.EasyAF.Configuration.ConfigurationBase` Determines how HttpClient message handlers are configured when registering HTTP clients. Controls whether handlers are added to existing handlers or replace them entirely. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Core.HttpHandlerMode HttpHandlerMode { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Core.HttpHandlerMode` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # HttpEndpointAttribute Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Configuration/HttpEndpointAttribute Specifies that a configuration property represents an HTTP endpoint URL for an HttpClient. Used by the EasyAF configuration system to automatically register... ## Definition **Assembly:** CloudNimble.EasyAF.Configuration.dll **Namespace:** CloudNimble.EasyAF.Configuration **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Configuration.HttpEndpointAttribute ``` ## Summary Specifies that a configuration property represents an HTTP endpoint URL for an HttpClient. Used by the EasyAF configuration system to automatically register HttpClients with their base addresses. ## Remarks This attribute enables automatic HttpClient registration by linking configuration properties that contain URLs to the corresponding HttpClient name properties. The configuration system uses this information to set up named HttpClient instances with appropriate base addresses. ## Examples ```csharp theme={"dark"} public class MyConfiguration : ConfigurationBase { public string MyApiClientName { get; set; } = "MyApiClient"; [HttpEndpoint(nameof(MyApiClientName))] public string MyApiRoot { get; set; } = "https://api.example.com"; } // This will automatically register an HttpClient named "MyApiClient" // with base address "https://api.example.com" ``` ## Constructors ### .ctor Initializes a new instance of the [HttpEndpointAttribute](/api-reference/CloudNimble/EasyAF/Configuration/HttpEndpointAttribute) class. #### Syntax ```csharp theme={"dark"} public HttpEndpointAttribute(string clientNameProperty) ``` #### Parameters | Name | Type | Description | | - | - | - | | `clientNameProperty` | `string` | The name of the property that contains the HttpClient name for registration. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *clientNameProperty* is null. | ## Properties ### ClientNameProperty Gets or sets the name of the property that contains the HttpClient name to be registered. This property should contain the string value that will be used as the named HttpClient identifier. #### Syntax ```csharp theme={"dark"} public string ClientNameProperty { get; set; } ``` #### Property Value Type: `string` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Configuration/index Summary of the CloudNimble.EasyAF.Configuration Namespace ## Types ### Classes | Name | Summary | | - | - | | [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase) | A base class implementation of the configuration your Blazor app will pull from wwwroot/appsettings.json. Provides standard HttpClient configuration for API and application endpoints. | | [ConfigurationPlusAdminBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationPlusAdminBase) | An extended configuration class that includes both public and administrative endpoint configuration. Inherits from [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase) and adds support for administrative APIs and applications. | | [HttpEndpointAttribute](/api-reference/CloudNimble/EasyAF/Configuration/HttpEndpointAttribute) | Specifies that a configuration property represents an HTTP endpoint URL for an HttpClient. Used by the EasyAF configuration system to automatically register HttpClients with their base addresses. | # IgnoreAuditFieldsJsonConverter Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/Converters/IgnoreAuditFieldsJsonConverter A [JsonConverter`1](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1) that ignores the audit properties on a [DbObservab... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core.Converters **Inheritance:** System.Text.Json.Serialization.JsonConverter\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.Converters.IgnoreAuditFieldsJsonConverter ``` ## Summary A [JsonConverter\`1](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1) that ignores the audit properties on a [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject). ## Usage `IgnoreAuditFieldsJsonConverter` and `IgnoreAuditFieldsJsonConverterFactory` are obsolete as of EasyAF 5.0. Call `IgnoreAuditFields()` on your `JsonSerializerOptions` instead. `IgnoreAuditFields()` stops `DateCreated`, `CreatedById`, `DateUpdated`, and `UpdatedById` from being written when any `DbObservableObject` is serialized. Audit fields are still read when deserializing. Use it on the client when you send entities back to an API, so the server stays the only source of audit values. ## Migrating from the converter Remove the factory from `Converters`, and chain `IgnoreAuditFields()` onto the options: ```csharp theme={"dark"} // EasyAF 4.x private JsonSerializerOptions jsonSerializerOptions = new() { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, Converters = { new JsonStringEnumConverter(), new IgnoreAuditFieldsJsonConverterFactory() }, TypeInfoResolver = new DefaultJsonTypeInfoResolver() }; // EasyAF 5.0 private JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, Converters = { new JsonStringEnumConverter() }, }.IgnoreAuditFields(); ``` `IgnoreAuditFields()` returns the same instance, and must be called before the options are first used. ## Native AOT and source generation If `TypeInfoResolver` is already set, `IgnoreAuditFields()` adds to it instead of replacing it, so it works with a source-generated context: ```csharp theme={"dark"} [JsonSerializable(typeof(Scenario))] internal partial class AppJsonContext : JsonSerializerContext; var options = new JsonSerializerOptions { TypeInfoResolver = AppJsonContext.Default, }.IgnoreAuditFields(); ``` ## Performance The audit properties are removed from each type's serialization contract once, the first time that type is serialized. After that, serialization runs at the same speed as plain System.Text.Json. The 4.x converter used reflection on every call. In EasyAF's benchmarks, serializing an entity dropped from 1,545.0 ns and 5,240 B to 111.2 ns and 416 B. See the [release notes](/release-notes) for the full comparison. ## Remarks As of EasyAF 5.0, this converter delegates to the same contract modifier as [JsonSerializerOptions)](https://learn.microsoft.com/dotnet/api/system.text.json.easyaf_jsonserializeroptionsextensions.ignoreauditfields\(system.text.json.jsonserializeroptions\)), so every System.Text.Json setting is honored. ## Considerations ## Output changes in EasyAF 5.0 In 5.0, both `IgnoreAuditFields()` and the obsolete converter let System.Text.Json write the whole object, so every serializer setting applies. The 4.x converter wrote each property itself, and skipped several settings. If you depend on the 4.x output, here is what changed and how to restore it. | Change | 4.x output | 5.0 output | To restore the 4.x output | | - | - | - | - | | `DefaultIgnoreCondition` | Only `null` values were skipped, even with `WhenWritingDefault`. `0`, `false`, and `Guid.Empty` were written. | `WhenWritingDefault` also skips `0`, `false`, and `Guid.Empty`. | Use `JsonIgnoreCondition.WhenWritingNull`. | | Naming policies and `[JsonPropertyName]` | Top-level property names were always the C# names. | The naming policy and `[JsonPropertyName]` apply. | Remove `PropertyNamingPolicy` from these options. | | Related entities | Audit fields were still written on related entities (for example, `Order.Customer.DateCreated`). | Audit fields are removed on every `DbObservableObject` in the graph. | Serialize the related entity separately, with options that do not call `IgnoreAuditFields()`. | | Property types | Values were written using their runtime type. | Values are written using their declared type, like the rest of System.Text.Json. | Add `[JsonDerivedType]` to the base type, or declare the property as `object`. | If your options use `JsonIgnoreCondition.WhenWritingDefault`, check any `POST` or `PATCH` that depends on sending `false`, `0`, or `Guid.Empty`. Those values are no longer written, so the server's default value is used instead. ## Other considerations * `[JsonIgnore]` is honored, as it was in 4.x. * Only types that inherit from `DbObservableObject` are affected. Other types with a `DateCreated` property are serialized normally. * `IgnoreAuditFields()` throws `InvalidOperationException` if the options have already been used, because System.Text.Json makes options read-only after first use. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IgnoreAuditFieldsJsonConverter(System.Text.Json.JsonSerializerOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `System.Text.Json.JsonSerializerOptions` | - | ## Properties ### HandleNull Override #### Syntax ```csharp theme={"dark"} public override bool HandleNull { get; } ``` #### Property Value Type: `bool` ## Methods ### Read Override #### Syntax ```csharp theme={"dark"} public override T Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `reader` | `System.Text.Json.Utf8JsonReader` | - | | `typeToConvert` | `System.Type` | - | | `options` | `System.Text.Json.JsonSerializerOptions` | - | #### Returns Type: `T` ### Write Override #### Syntax ```csharp theme={"dark"} public override void Write(System.Text.Json.Utf8JsonWriter writer, T value, System.Text.Json.JsonSerializerOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `writer` | `System.Text.Json.Utf8JsonWriter` | - | | `value` | `T` | - | | `options` | `System.Text.Json.JsonSerializerOptions` | - | # IgnoreAuditFieldsJsonConverterFactory Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/Converters/IgnoreAuditFieldsJsonConverterFactory The converter we create needs to know the exact type we're converting, otherwise you would only get base object properties every time. Therefore it has to be... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core.Converters **Inheritance:** System.Text.Json.Serialization.JsonConverterFactory ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.Converters.IgnoreAuditFieldsJsonConverterFactory ``` ## Summary The converter we create needs to know the exact type we're converting, otherwise you would only get base object properties every time. Therefore it has to be generic. So the Factory creates the right Converter instance type for the object and sends it on its' way. For more details, [see Microsoft's converter documentation.](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to?pivots=dotnet-6-0) ## Usage `IgnoreAuditFieldsJsonConverterFactory` is obsolete as of EasyAF 5.0. Call `IgnoreAuditFields()` on your `JsonSerializerOptions` instead. ```csharp theme={"dark"} var options = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, }.IgnoreAuditFields(); ``` See [IgnoreAuditFieldsJsonConverter](/api-reference/CloudNimble/EasyAF/Core/Converters/IgnoreAuditFieldsJsonConverter) for migration steps, and for the 5.0 output changes and how to restore the 4.x output. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IgnoreAuditFieldsJsonConverterFactory() ``` ## Methods ### CanConvert Override #### Syntax ```csharp theme={"dark"} public override bool CanConvert(System.Type typeToConvert) ``` #### Parameters | Name | Type | Description | | - | - | - | | `typeToConvert` | `System.Type` | - | #### Returns Type: `bool` ### CreateConverter Override #### Syntax ```csharp theme={"dark"} public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `typeToConvert` | `System.Type` | - | | `options` | `System.Text.Json.JsonSerializerOptions` | - | #### Returns Type: `System.Text.Json.Serialization.JsonConverter` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/Converters/index Summary of the CloudNimble.EasyAF.Core.Converters Namespace ## Types ### Classes | Name | Summary | | - | - | | [IgnoreAuditFieldsJsonConverter](/api-reference/CloudNimble/EasyAF/Core/Converters/IgnoreAuditFieldsJsonConverter) | A [JsonConverter\`1](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1) that ignores the audit properties on a [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject). | | [IgnoreAuditFieldsJsonConverterFactory](/api-reference/CloudNimble/EasyAF/Core/Converters/IgnoreAuditFieldsJsonConverterFactory) | The converter we create needs to know the exact type we're converting, otherwise you would only get base object properties every time. Therefore it has to be generic. So the Factory creates the right Converter instance type for the object and sends it on its' way. For more details, [see Microsoft's converter documentation.](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to?pivots=dotnet-6-0) | # DbObservableObject Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/DbObservableObject A base class for Entity Framework objects to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertyc... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** CloudNimble.EasyAF.Core.EasyObservableObject ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.DbObservableObject ``` ## Summary A base class for Entity Framework objects to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged), [IChangeTracking](https://learn.microsoft.com/dotnet/api/system.componentmodel.ichangetracking), and [IRevertibleChangeTracking](https://learn.microsoft.com/dotnet/api/system.componentmodel.irevertiblechangetracking) in front-end development. ## Remarks [https://stackoverflow.com/questions/2363801/what-would-be-the-best-way-to-implement-change-tracking-on-an-object](https://stackoverflow.com/questions/2363801/what-would-be-the-best-way-to-implement-change-tracking-on-an-object) ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DbObservableObject() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Initializes a new instance of the [EasyObservableObject](/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject) class. #### Syntax ```csharp theme={"dark"} public EasyObservableObject() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### IsChanged Specifies whether or not the object has changed. #### Syntax ```csharp theme={"dark"} public bool IsChanged { get; set; } ``` #### Property Value Type: `bool` #### Remarks Setting this manually allows you to override the default behavior in case your app needs it. ### IsGraphChanged #### Syntax ```csharp theme={"dark"} public bool IsGraphChanged { get; } ``` #### Property Value Type: `bool` ### OriginalValues #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary OriginalValues { get; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### PropertyChangedHandler Inherited Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Provides access to the PropertyChanged event handler to derived classes. #### Syntax ```csharp theme={"dark"} protected internal System.ComponentModel.PropertyChangedEventHandler PropertyChangedHandler { get; } ``` #### Property Value Type: `System.ComponentModel.PropertyChangedEventHandler` ### ShouldTrackChanges Specifies whether or not property value changes should be tracked. #### Syntax ```csharp theme={"dark"} public bool ShouldTrackChanges { get; internal set; } ``` #### Property Value Type: `bool` #### Remarks To track changes, call `Boolean)`. PropertyChanged events will still be fired, regardless of this setting. ## Methods ### AcceptChanges Clears the [DbObservableObject.OriginalValues](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#originalvalues) list and sets [DbObservableObject.IsChanged](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#ischanged) to [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). #### Syntax ```csharp theme={"dark"} public void AcceptChanges() ``` ### AcceptChanges Clears the [DbObservableObject.OriginalValues](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#originalvalues) list and sets [DbObservableObject.IsChanged](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#ischanged) to [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), and optionally traverses the object graph to call [DbObservableObject.AcceptChanges](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#acceptchanges) on any children. #### Syntax ```csharp theme={"dark"} public void AcceptChanges(bool goDeep) ``` #### Parameters | Name | Type | Description | | - | - | - | | `goDeep` | `bool` | - | ### ClearRelationships Sets any child relationships (0..1:1 or 1:\*) to null. #### Syntax ```csharp theme={"dark"} public void ClearRelationships() ``` #### Remarks This is typically used to clean an entity before it is POSTed or PUT over an OData API. ### Clone Inherited Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Creates a deep copy of the current object using JSON serialization. #### Syntax ```csharp theme={"dark"} public T Clone() where T : CloudNimble.EasyAF.Core.EasyObservableObject ``` #### Returns Type: `T` A new instance of type *T* that is a deep copy of the current object. #### Type Parameters * `T` - The type of object to clone. Must inherit from [EasyObservableObject](/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject). #### Exceptions | Exception | Description | | - | - | | `JsonException` | Thrown when the object cannot be serialized or deserialized. | ### Dispose Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Releases the unmanaged resources used by the [EasyObservableObject](/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject) and optionally releases the managed resources. #### Syntax ```csharp theme={"dark"} protected internal virtual void Dispose(bool disposing) ``` #### Parameters | Name | Type | Description | | - | - | - | | `disposing` | `bool` | true to release both managed and unmanaged resources; false to release only unmanaged resources. | ### Dispose Inherited Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetRelatedEntityCollectionProperties #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetRelatedEntityCollectionProperties() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` ### GetRelatedEntityProperties #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetRelatedEntityProperties() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### RaisePropertyChanged Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Raises the PropertyChanged event if needed. #### Syntax ```csharp theme={"dark"} protected internal virtual void RaisePropertyChanged(string propertyName = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the property that changed. | #### Remarks If the propertyName parameter does not correspond to an existing property on the current class, an exception is thrown in DEBUG configuration only. ### RaisePropertyChanged Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Raises the PropertyChanged event if needed. #### Syntax ```csharp theme={"dark"} protected internal virtual void RaisePropertyChanged(System.Linq.Expressions.Expression> propertyExpression) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyExpression` | `System.Linq.Expressions.Expression>` | An expression identifying the property that changed. | #### Type Parameters * `T` - The type of the property that changed. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RejectChanges Loops through the [DbObservableObject.OriginalValues](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#originalvalues) list, sets any property that has changed back to the value it had when `Boolean)` was called, clears the [DbObservableObject.OriginalValues](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#originalvalues) list, and sets [DbObservableObject.IsChanged](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#ischanged) to [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). #### Syntax ```csharp theme={"dark"} public void RejectChanges() ``` ### RejectChanges #### Syntax ```csharp theme={"dark"} public void RejectChanges(bool goDeep) ``` #### Parameters | Name | Type | Description | | - | - | - | | `goDeep` | `bool` | - | ### Set Inherited Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Assigns a new value to the property. Then, raises the PropertyChanged event if needed. #### Syntax ```csharp theme={"dark"} protected internal void Set(System.Linq.Expressions.Expression> propertyExpression, ref T field, T newValue) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyExpression` | `System.Linq.Expressions.Expression>` | An expression identifying the property that changed. | | `field` | `T` | The field storing the property's value. | | `newValue` | `T` | The property's value after the change occurred. | #### Type Parameters * `T` - The type of the property that changed. ### Set Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Assigns a new value to the property. Then, raises the PropertyChanged event if needed. #### Syntax ```csharp theme={"dark"} protected internal virtual void Set(string propertyName, ref T field, T newValue) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the property that changed. | | `field` | `T` | The field storing the property's value. | | `newValue` | `T` | The property's value after the change occurred. | #### Type Parameters * `T` - The type of the property that changed. ### ToDeltaPayload Loops through the keys in the [DbObservableObject.OriginalValues](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject#originalvalues) list and returns an [ExpandoObject](https://learn.microsoft.com/dotnet/api/system.dynamic.expandoobject) containing JUST the new values for the properties that changed. #### Syntax ```csharp theme={"dark"} public System.Dynamic.ExpandoObject ToDeltaPayload(bool deepTracking = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `deepTracking` | `bool` | - | #### Returns Type: `System.Dynamic.ExpandoObject` An [ExpandoObject](https://learn.microsoft.com/dotnet/api/system.dynamic.expandoobject) containing JUST the new values for the properties that changed. #### Remarks If the object implements `IIdentifiable`1\`, then the payload will always include the ID. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### TrackChanges Starts tracking property value changes for every property, optionally activating this behavior for the entire object graph. #### Syntax ```csharp theme={"dark"} public void TrackChanges(bool deepTracking = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `deepTracking` | `bool` | When [`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), loops recursively through the object graph and calls `Boolean)` on every object that | | inherits from [EasyObservableObject](/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject). | | | ## Events ### PropertyChanged Inherited Inherited from `CloudNimble.EasyAF.Core.EasyObservableObject` Occurs when a property value changes. #### Syntax ```csharp theme={"dark"} public System.ComponentModel.PropertyChangedEventHandler PropertyChanged ``` ## Related APIs * System.ComponentModel.INotifyPropertyChanged * System.IDisposable * System.ComponentModel.IChangeTracking * System.ComponentModel.IRevertibleChangeTracking # EasyObservableObject Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject A base class for objects to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged). Provides... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.EasyObservableObject ``` ## Summary A base class for objects to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged). Provides strongly-typed property change notifications and automatic property setting with change detection. ## Examples ```csharp theme={"dark"} public class Person : EasyObservableObject { private string _name; private int _age; public string Name { get => _name; set => Set(nameof(Name), ref _name, value); } public int Age { get => _age; set => Set(nameof(Age), ref _age, value); } } ``` ## Constructors ### .ctor Initializes a new instance of the [EasyObservableObject](/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject) class. #### Syntax ```csharp theme={"dark"} public EasyObservableObject() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Clone Creates a deep copy of the current object using JSON serialization. #### Syntax ```csharp theme={"dark"} public T Clone() where T : CloudNimble.EasyAF.Core.EasyObservableObject ``` #### Returns Type: `T` A new instance of type *T* that is a deep copy of the current object. #### Type Parameters * `T` - The type of object to clone. Must inherit from [EasyObservableObject](/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject). #### Exceptions | Exception | Description | | - | - | | `JsonException` | Thrown when the object cannot be serialized or deserialized. | ### Dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Events ### PropertyChanged Occurs when a property value changes. #### Syntax ```csharp theme={"dark"} public System.ComponentModel.PropertyChangedEventHandler PropertyChanged ``` ## Related APIs * System.ComponentModel.INotifyPropertyChanged * System.IDisposable # Ensure Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/Ensure Provides methods for ensuring that method arguments meet specific criteria. This class provides a consistent way to validate arguments and throw appropriate ... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.Ensure ``` ## Summary Provides methods for ensuring that method arguments meet specific criteria. This class provides a consistent way to validate arguments and throw appropriate exceptions. ## Examples ```csharp theme={"dark"} public void ProcessData(string input, List<string> items) { Ensure.ArgumentNotNull(input, nameof(input)); Ensure.ArgumentNotNull(items, nameof(items)); // Process the validated arguments } ``` ## Methods ### ArgumentNotNull Ensures that the specified argument is not null. #### Syntax ```csharp theme={"dark"} public static void ArgumentNotNull(object argument, string argumentName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `argument` | `object` | The argument to validate. | | `argumentName` | `string` | The name of the argument being validated. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *argument* is null. | ### ArgumentNotNullOrWhiteSpace Ensures that the specified argument is not null or whitespace. #### Syntax ```csharp theme={"dark"} public static void ArgumentNotNullOrWhiteSpace(string argument, string argumentName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `argument` | `string` | The argument to validate. | | `argumentName` | `string` | The name of the argument being validated. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *argument* is null or whitespace. | # HttpHandlerMode Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/HttpHandlerMode Specifies how HttpClient message handlers should be configured when registering HTTP clients. Determines whether handlers are added to existing handlers or r... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.HttpHandlerMode ``` ## Summary Specifies how HttpClient message handlers should be configured when registering HTTP clients. Determines whether handlers are added to existing handlers or replace them entirely. ## Values | Name | Value | Description | | - | - | - | | `None` | 0 | No custom message handlers are configured for the HttpClient. | | Uses the default handler configuration provided by the HttpClientFactory. | | | | `Add` | 1 | Adds custom message handlers to the existing handler pipeline. | | Custom handlers are appended to any existing handlers already configured. | | | | `Replace` | 2 | Replaces the entire handler pipeline with custom message handlers. | | All existing handlers are removed and replaced with the specified custom handlers. | | | # IActiveTrackable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IActiveTrackable An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IActiveTrackable ``` ## Summary An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Properties ### IsActive Abstract The unique identifier for the User that created this particular Entity. #### Syntax ```csharp theme={"dark"} bool IsActive { get; set; } ``` #### Property Value Type: `bool` # ICreatedAuditable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.ICreatedAuditable ``` ## Summary An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Properties ### DateCreated Abstract The unique identifier for the User that created this particular Entity. #### Syntax ```csharp theme={"dark"} System.DateTimeOffset DateCreated { get; set; } ``` #### Property Value Type: `System.DateTimeOffset` # ICreatorTrackable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/ICreatorTrackable An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.ICreatorTrackable ``` ## Summary An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Type Parameters * `T` - The type for the identifier. ## Properties ### CreatedById Abstract The unique identifier for the User that created this particular Entity. #### Syntax ```csharp theme={"dark"} T CreatedById { get; set; } ``` #### Property Value Type: `T` # IDbEnum Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IDbEnum An interface that represents the CloudNimble database-driven enumeration pattern that lets you update the Enum as processes change without changing the meani... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IDbEnum ``` ## Summary An interface that represents the CloudNimble database-driven enumeration pattern that lets you update the Enum as processes change without changing the meaning of Entities that are linked to the older enums. ## Related APIs * CloudNimble.EasyAF.Core.IIdentifiable\ * CloudNimble.EasyAF.Core.IActiveTrackable * CloudNimble.EasyAF.Core.IHumanReadable * CloudNimble.EasyAF.Core.ISortable # IDbStateEnum Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IDbStateEnum An interface that identifies this Entity as being the enumeration details for the SimpleStateMachine. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IDbStateEnum ``` ## Summary An interface that identifies this Entity as being the enumeration details for the SimpleStateMachine. ## Properties ### InstructionText Abstract Text to display to the user regarding the current state, and what needs to happen next. #### Syntax ```csharp theme={"dark"} string InstructionText { get; set; } ``` #### Property Value Type: `string` ### PrimaryTargetDisplayText Abstract A string that describes the next action in the SimpleStateMachine, usually displayed on a button or link. #### Syntax ```csharp theme={"dark"} string PrimaryTargetDisplayText { get; set; } ``` #### Property Value Type: `string` ### PrimaryTargetSortOrder Abstract An integer that represents the State the Entity should be moved to once this action completes successfully. #### Syntax ```csharp theme={"dark"} int PrimaryTargetSortOrder { get; set; } ``` #### Property Value Type: `int` ### SecondaryTargetDisplayText Abstract A string that describes an alternate action in the SimpleStateMachine. This action could skip States moving forward, or return the Entity to a previous State. This text is usually displayed on a button or link. #### Syntax ```csharp theme={"dark"} string SecondaryTargetDisplayText { get; set; } ``` #### Property Value Type: `string` ### SecondaryTargetSortOrder Abstract An integer that represents an alternate State the Entity should be moved to once this action is finished. #### Syntax ```csharp theme={"dark"} int SecondaryTargetSortOrder { get; set; } ``` #### Property Value Type: `int` ## Related APIs * CloudNimble.EasyAF.Core.IDbEnum * CloudNimble.EasyAF.Core.IIdentifiable\ * CloudNimble.EasyAF.Core.IActiveTrackable * CloudNimble.EasyAF.Core.IHumanReadable * CloudNimble.EasyAF.Core.ISortable # IDbStatusEnum Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IDbStatusEnum An interface that identifies this Entity as being the enumeration details for the SimpleStateMachine. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IDbStatusEnum ``` ## Summary An interface that identifies this Entity as being the enumeration details for the SimpleStateMachine. ## Related APIs * CloudNimble.EasyAF.Core.IDbEnum * CloudNimble.EasyAF.Core.IIdentifiable\ * CloudNimble.EasyAF.Core.IActiveTrackable * CloudNimble.EasyAF.Core.IHumanReadable * CloudNimble.EasyAF.Core.ISortable # IHasState Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IHasState An interface that specifes an implementing Entity changes State as part of the SimpleStateMachine. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IHasState ``` ## Summary An interface that specifes an implementing Entity changes State as part of the SimpleStateMachine. ## Type Parameters * `T` - The type implementing [IDbStateEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStateEnum) that represents States for this Entity. ## Properties ### StateType Abstract The populated instance of [IDbStateEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStateEnum). #### Syntax ```csharp theme={"dark"} T StateType { get; set; } ``` #### Property Value Type: `T` ### StateTypeId Abstract The unique identifier for the SimpleStateMachine [IDbStateEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStateEnum). #### Syntax ```csharp theme={"dark"} System.Guid StateTypeId { get; set; } ``` #### Property Value Type: `System.Guid` ## Related APIs * CloudNimble.EasyAF.Core.IIdentifiable\ # IHasStatus Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IHasStatus An interface that specifes an implementing Entity contains a child Entity of T that implements [IDbStatusEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStat... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IHasStatus ``` ## Summary An interface that specifes an implementing Entity contains a child Entity of T that implements [IDbStatusEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStatusEnum) and represents the Entity's current status. ## Type Parameters * `T` - The type implementing [IDbStatusEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStatusEnum). ## Properties ### StatusType Abstract The populated instance of [IDbStatusEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStatusEnum). #### Syntax ```csharp theme={"dark"} T StatusType { get; set; } ``` #### Property Value Type: `T` ### StatusTypeId Abstract The unique identifier for the SimpleStateMachine [IDbStatusEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStatusEnum). #### Syntax ```csharp theme={"dark"} System.Guid StatusTypeId { get; set; } ``` #### Property Value Type: `System.Guid` ## Related APIs * CloudNimble.EasyAF.Core.IIdentifiable\ # IHumanReadable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IHumanReadable An interface that specifies the implementing Entity displays text to the user. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IHumanReadable ``` ## Summary An interface that specifies the implementing Entity displays text to the user. ## Properties ### DisplayName Abstract The text to be displayed to the user. #### Syntax ```csharp theme={"dark"} string DisplayName { get; set; } ``` #### Property Value Type: `string` # IIdentifiable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IIdentifiable An interface that guarantees a particular Entity contains an 'Id' property with a type *T*. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IIdentifiable ``` ## Summary An interface that guarantees a particular Entity contains an "Id" property with a type *T*. ## Type Parameters * `T` - The type for the identifier. ## Properties ### Id Abstract The unique identifier for this particular Entity. #### Syntax ```csharp theme={"dark"} T Id { get; set; } ``` #### Property Value Type: `T` # IIdentifiableEqualityComparer Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IIdentifiableEqualityComparer Provides an equality comparer for objects that implement `IIdentifiable`1`. Compares objects based on their Id property values for equality and hash code gen... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IIdentifiableEqualityComparer ``` ## Summary Provides an equality comparer for objects that implement `IIdentifiable`1\`. Compares objects based on their Id property values for equality and hash code generation. ## Type Parameters * `T` - The type of the identifier used by the identifiable objects. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IIdentifiableEqualityComparer() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Determines whether the specified `IIdentifiable`1\` objects are equal by comparing their Id properties. #### Syntax ```csharp theme={"dark"} public bool Equals(CloudNimble.EasyAF.Core.IIdentifiable x, CloudNimble.EasyAF.Core.IIdentifiable y) ``` #### Parameters | Name | Type | Description | | - | - | - | | `x` | `CloudNimble.EasyAF.Core.IIdentifiable` | The first object to compare. | | `y` | `CloudNimble.EasyAF.Core.IIdentifiable` | The second object to compare. | #### Returns Type: `bool` True if the objects are equal (including both being null), false otherwise. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Returns a hash code for the specified `IIdentifiable`1\` object based on its Id property. #### Syntax ```csharp theme={"dark"} public int GetHashCode(CloudNimble.EasyAF.Core.IIdentifiable obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `CloudNimble.EasyAF.Core.IIdentifiable` | The object for which to get a hash code. | #### Returns Type: `int` A hash code for the specified object. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when obj is null. | ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.Collections.Generic.IEqualityComparer\> # ISortable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/ISortable An interface that specifies the implementing Entity can be contains an [Int32](https://learn.microsoft.com/dotnet/api/system.int32) that tracks the order ite... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.ISortable ``` ## Summary An interface that specifies the implementing Entity can be contains an [Int32](https://learn.microsoft.com/dotnet/api/system.int32) that tracks the order items should be displayed in a list. ## Properties ### SortOrder Abstract The order this entity should be displayed in a list. #### Syntax ```csharp theme={"dark"} int SortOrder { get; set; } ``` #### Property Value Type: `int` # IUpdatedAuditable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IUpdatedAuditable ``` ## Summary An interface that implements the CloudNimble common pattern for tracking who created an Entity. ## Properties ### DateUpdated Abstract The unique identifier for the User that created this particular Entity. #### Syntax ```csharp theme={"dark"} System.Nullable DateUpdated { get; set; } ``` #### Property Value Type: `System.Nullable` # IUpdaterTrackable Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IUpdaterTrackable An interface that implements the CloudNimble common pattern for tracking who updated an Entity. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IUpdaterTrackable ``` ## Summary An interface that implements the CloudNimble common pattern for tracking who updated an Entity. ## Type Parameters * `T` - The type for the identifier. ## Properties ### UpdatedById Abstract The unique identifier for the User that updated this particular Entity. #### Syntax ```csharp theme={"dark"} System.Nullable UpdatedById { get; set; } ``` #### Property Value Type: `System.Nullable` # Interval Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/Interval Describes an interval of time to be used in time-based calculations. Provides methods to calculate rates and frequencies based on the interval value and type. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.Interval ``` ## Summary Describes an interval of time to be used in time-based calculations. Provides methods to calculate rates and frequencies based on the interval value and type. ## Type Parameters * `T` - The data type for the interval value. Must implement [IComparable\`1](https://learn.microsoft.com/dotnet/api/system.icomparable-1) and [IConvertible](https://learn.microsoft.com/dotnet/api/system.iconvertible). ## Examples ```csharp theme={"dark"} // Create an interval representing something that happens every 3 hours var interval = new Interval<int>(3, IntervalType.Hours); // Calculate how many times per day this would occur decimal timesPerDay = interval.PerDay(); // Returns 8.0 // Calculate how many minutes between occurrences decimal minutesBetween = interval.PerMinute(); // Returns 0.0556 (1/18) ``` ## Constructors ### .ctor Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval() ``` ### .ctor Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval(T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this Interval references. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Type The base unit that describes what the quantity of this Interval references. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Core.IntervalType Type { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Core.IntervalType` ### Value The duration of the Interval. #### Syntax ```csharp theme={"dark"} public T Value { get; set; } ``` #### Property Value Type: `T` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PerDay Virtual Given this `Interval`1\` instance, calculates how many occurrences will happen per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay() ``` #### Returns Type: `System.Decimal` The number of occurrences per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerDay Virtual Given this `Interval`1\` instance and a quantity, calculates the total output per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per day var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerDay = production.PerDay(100); // 1600 widgets per day (16 * 100) ``` ### PerHour Virtual Given this `Interval`1\` instance, calculates how many occurrences will happen per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour() ``` #### Returns Type: `System.Decimal` The number of occurrences per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerHour Virtual Given this `Interval`1\` instance and a quantity, calculates the total output per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per hour var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerHour = production.PerHour(100); // 66.67 widgets per hour (1/1.5 * 100) ``` ### PerMinute Virtual Given this `Interval`1\` instance, calculates how many occurrences will happen per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute() ``` #### Returns Type: `System.Decimal` The number of occurrences per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Remarks If you need this as a whole number, wrap the result in [Decimal)](https://learn.microsoft.com/dotnet/api/system.math.floor\(system.decimal\)). ### PerMinute Virtual Given this `Interval`1\` instance and a quantity, calculates the total output per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 90 minutes, total from 100 units of material per minute var production = new Interval<int>(90, IntervalType.Minutes); decimal totalPerMinute = production.PerMinute(100); // 1.11 widgets per minute (1/90 * 100) ``` ### PerMonth Virtual Given this `Interval`1\` instance, calculates how many occurrences will happen per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth() ``` #### Returns Type: `System.Decimal` The number of occurrences per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerMonth Virtual Given this `Interval`1\` instance and a quantity, calculates the total output per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 3 days, total from 200 units of material per month var production = new Interval<int>(3, IntervalType.Days); decimal totalPerMonth = production.PerMonth(200); // 2000 widgets per month (10 * 200) ``` ### PerWeek Virtual Given this `Interval`1\` instance, calculates how many occurrences will happen per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek() ``` #### Returns Type: `System.Decimal` The number of occurrences per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerWeek Virtual Given this `Interval`1\` instance and a quantity, calculates the total output per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 2 days, total from 50 units of material per week var production = new Interval<int>(2, IntervalType.Days); decimal totalPerWeek = production.PerWeek(50); // 175 widgets per week (3.5 * 50) ``` ### PerYear Virtual Given this `Interval`1\` instance, calculates how many occurrences will happen per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear() ``` #### Returns Type: `System.Decimal` The number of occurrences per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerYear Virtual Given this `Interval`1\` instance and a quantity, calculates the total output per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1 week, total from 500 units of material per year var production = new Interval<int>(1, IntervalType.Weeks); decimal totalPerYear = production.PerYear(500); // 26071 widgets per year (52.14 * 500) ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Override #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IntervalType Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/IntervalType Specifies the type of interval duration. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.IntervalType ``` ## Summary Specifies the type of interval duration. ## Values | Name | Value | Description | | - | - | - | | `Minutes` | 0 | Represents an interval measured in minutes. | | `Hours` | 1 | Represents an interval measured in hours. | | `Days` | 2 | Represents an interval measured in days. | | `Weeks` | 3 | Represents an interval measured in weeks. | | `Months` | 4 | Represents an interval measured in months. | | `Quarters` | 5 | Represents an interval measured in quarters (3-month periods). | | `Years` | 6 | Represents an interval measured in years. | # MoneyInterval Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/MoneyInterval Represents a sum of money to be exchanged during a given interval. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** CloudNimble.EasyAF.Core.Interval\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.MoneyInterval ``` ## Summary Represents a sum of money to be exchanged during a given interval. ## Remarks This has been broken up to allow for conversions (for example, converting $/month into $/day) to be self-contained. This should reduce duplication. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public MoneyInterval() ``` ### .ctor Initializes a new instance of the `MoneyInterval`1\` class with the specified interval value and type. #### Syntax ```csharp theme={"dark"} public MoneyInterval(T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this interval references. | ### .ctor Initializes a new instance of the `MoneyInterval`1\` class with the specified money amount, interval value, and type. #### Syntax ```csharp theme={"dark"} public MoneyInterval(System.Decimal money, T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `money` | `System.Decimal` | The amount of money represented by the given interval. | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this interval references. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval(T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this Interval references. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Money The amount of money represented by the given [IntervalType](/api-reference/CloudNimble/EasyAF/Core/IntervalType) #### Syntax ```csharp theme={"dark"} public System.Decimal Money { get; set; } ``` #### Property Value Type: `System.Decimal` ### Type Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` The base unit that describes what the quantity of this Interval references. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Core.IntervalType Type { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Core.IntervalType` ### Value Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` The duration of the Interval. #### Syntax ```csharp theme={"dark"} public T Value { get; set; } ``` #### Property Value Type: `T` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PerDay Override Calculates the monetary amount per day based on this money interval. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerDay() ``` #### Returns Type: `System.Decimal` The amount of money per day as a decimal value. ### PerDay Override Calculates the total monetary amount per day based on this money interval and a quantity multiplier. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerDay(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity multiplier (e.g., hours worked, units sold). | #### Returns Type: `System.Decimal` The total amount of money per day as a decimal value. #### Examples ```csharp theme={"dark"} // $25 per hour wage, calculate earnings for 8 hours of work per day var wage = new MoneyInterval<double>(25m, 1, IntervalType.Hours); decimal totalPerDay = wage.PerDay(8); // $4800 per day (25 * 24 * 8) ``` ### PerDay Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay() ``` #### Returns Type: `System.Decimal` The number of occurrences per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerDay Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per day var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerDay = production.PerDay(100); // 1600 widgets per day (16 * 100) ``` ### PerHour Override Calculates the monetary amount per hour based on this money interval. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerHour() ``` #### Returns Type: `System.Decimal` The amount of money per hour as a decimal value. ### PerHour Override Calculates the total monetary amount per hour based on this money interval and a quantity multiplier. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerHour(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity multiplier (e.g., hours worked, units sold). | #### Returns Type: `System.Decimal` The total amount of money per hour as a decimal value. #### Examples ```csharp theme={"dark"} // $25 per hour wage, calculate earnings for 8 hours of work per hour var wage = new MoneyInterval<double>(25m, 1, IntervalType.Hours); decimal totalPerHour = wage.PerHour(8); // $200 per hour (25 * 8) ``` ### PerHour Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour() ``` #### Returns Type: `System.Decimal` The number of occurrences per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerHour Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per hour var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerHour = production.PerHour(100); // 66.67 widgets per hour (1/1.5 * 100) ``` ### PerMinute Override Calculates the monetary amount per minute based on this money interval. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerMinute() ``` #### Returns Type: `System.Decimal` The amount of money per minute as a decimal value. ### PerMinute Override Calculates the total monetary amount per minute based on this money interval and a quantity multiplier. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerMinute(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity multiplier (e.g., hours worked, units sold). | #### Returns Type: `System.Decimal` The total amount of money per minute as a decimal value. #### Examples ```csharp theme={"dark"} // $25 per hour wage, calculate earnings for 8 hours of work per minute var wage = new MoneyInterval<double>(25m, 1, IntervalType.Hours); decimal totalPerMinute = wage.PerMinute(8); // $3.33 per minute (25 * 8 / 60) ``` ### PerMinute Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute() ``` #### Returns Type: `System.Decimal` The number of occurrences per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Remarks If you need this as a whole number, wrap the result in [Decimal)](https://learn.microsoft.com/dotnet/api/system.math.floor\(system.decimal\)). ### PerMinute Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 90 minutes, total from 100 units of material per minute var production = new Interval<int>(90, IntervalType.Minutes); decimal totalPerMinute = production.PerMinute(100); // 1.11 widgets per minute (1/90 * 100) ``` ### PerMonth Override Calculates the monetary amount per month based on this money interval. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerMonth() ``` #### Returns Type: `System.Decimal` The amount of money per month as a decimal value. ### PerMonth Override Calculates the total monetary amount per month based on this money interval and a quantity multiplier. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerMonth(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity multiplier (e.g., hours worked, units sold). | #### Returns Type: `System.Decimal` The total amount of money per month as a decimal value. #### Examples ```csharp theme={"dark"} // $50 per day, calculate earnings for 20 working days per month var dailyRate = new MoneyInterval<double>(50m, 1, IntervalType.Days); decimal totalPerMonth = dailyRate.PerMonth(20); // $30,000 per month (50 * 30 * 20) ``` ### PerMonth Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth() ``` #### Returns Type: `System.Decimal` The number of occurrences per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerMonth Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 3 days, total from 200 units of material per month var production = new Interval<int>(3, IntervalType.Days); decimal totalPerMonth = production.PerMonth(200); // 2000 widgets per month (10 * 200) ``` ### PerWeek Override Calculates the monetary amount per week based on this money interval. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerWeek() ``` #### Returns Type: `System.Decimal` The amount of money per week as a decimal value. ### PerWeek Override Calculates the total monetary amount per week based on this money interval and a quantity multiplier. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerWeek(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity multiplier (e.g., hours worked, units sold). | #### Returns Type: `System.Decimal` The total amount of money per week as a decimal value. #### Examples ```csharp theme={"dark"} // $150 every 2.5 hours, calculate earnings for 40 hours of work per week var freelance = new MoneyInterval<double>(150m, 2.5, IntervalType.Hours); decimal totalPerWeek = freelance.PerWeek(40); // $40,320 per week ``` ### PerWeek Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek() ``` #### Returns Type: `System.Decimal` The number of occurrences per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerWeek Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 2 days, total from 50 units of material per week var production = new Interval<int>(2, IntervalType.Days); decimal totalPerWeek = production.PerWeek(50); // 175 widgets per week (3.5 * 50) ``` ### PerYear Override Calculates the monetary amount per year based on this money interval. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerYear() ``` #### Returns Type: `System.Decimal` The amount of money per year as a decimal value. ### PerYear Override Calculates the total monetary amount per year based on this money interval and a quantity multiplier. #### Syntax ```csharp theme={"dark"} public override System.Decimal PerYear(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity multiplier (e.g., hours worked, units sold). | #### Returns Type: `System.Decimal` The total amount of money per year as a decimal value. #### Examples ```csharp theme={"dark"} // $75,000 annual salary, calculate total compensation with 1.2x multiplier var salary = new MoneyInterval<double>(75000m, 1, IntervalType.Years); decimal totalPerYear = salary.PerYear(1.2m); // $90,000 per year (75000 * 1.2) ``` ### PerYear Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear() ``` #### Returns Type: `System.Decimal` The number of occurrences per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerYear Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1 week, total from 500 units of material per year var production = new Interval<int>(1, IntervalType.Weeks); decimal totalPerYear = production.PerYear(500); // 26071 widgets per year (52.14 * 500) ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Override #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` ### ToString Returns a string representation of the money interval with the specified number of decimal places for the currency value. #### Syntax ```csharp theme={"dark"} public string ToString(int decimals) ``` #### Parameters | Name | Type | Description | | - | - | - | | `decimals` | `int` | The number of decimal places to display for the currency value. | #### Returns Type: `string` A formatted string showing the money amount per interval period. ### ToString Override Inherited from `CloudNimble.EasyAF.Core.Interval` #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NameOf Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/NameOf Fills a gap in `nameof` by allowing you to use deep name references instead of local name references. ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.NameOf ``` ## Summary Fills a gap in `nameof` by allowing you to use deep name references instead of local name references. ## Remarks Solution modified from [link](https://stackoverflow.com/a/58190566/403765). ## Methods ### Full Gets the full property path name from the specified expression, optionally using a custom separator. #### Syntax ```csharp theme={"dark"} public static string Full(System.Linq.Expressions.Expression> expression, string separator = ".") ``` #### Parameters | Name | Type | Description | | - | - | - | | `expression` | `System.Linq.Expressions.Expression>` | An expression pointing to the property whose full name should be returned. | | `separator` | `string` | The character(s) used to separate property names in the result. Defaults to ".". | #### Returns Type: `string` The full property path as a string with the specified separator. #### Type Parameters * `TSource` - The source type containing the property. ### Full Allows you to create a source name expression when you need to have a prefixing variable in the result. #### Syntax ```csharp theme={"dark"} public static string Full(string sourceFieldName, System.Linq.Expressions.Expression> expression, string separator = ".") ``` #### Parameters | Name | Type | Description | | - | - | - | | `sourceFieldName` | `string` | - | | `expression` | `System.Linq.Expressions.Expression>` | - | | `separator` | `string` | The characters used to separate the from the result. | #### Returns Type: `string` #### Type Parameters * `TSource` - # PercentageInterval Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/PercentageInterval Represents a percentage rate that occurs at regular time intervals, enabling conversion between different time periods. This class combines a base time inter... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** CloudNimble.EasyAF.Core.Interval\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.PercentageInterval ``` ## Summary Represents a percentage rate that occurs at regular time intervals, enabling conversion between different time periods. This class combines a base time interval (from the `Interval`1\` class) with a percentage rate to calculate total percentage amounts across different time periods. ## Remarks \Key Concepts:\ \Method Types:\ \Common Use Cases:\ ## Examples ```csharp theme={"dark"} // Example: 2.5% interest rate every quarter (3 months) var interestInterval = new PercentageInterval<double>(0.025, 3, IntervalType.Months); // How many quarters are there per year? decimal quartersPerYear = interestInterval.PerYear(); // 4 quarters // What's the total interest rate per year? decimal totalInterestPerYear = interestInterval.RatePerYear(); // 0.10 (0.025 × 4) // Monthly breakdown decimal totalInterestPerMonth = interestInterval.RatePerMonth(); // ~0.0083 (0.025 × 0.33) ``` ## Constructors ### .ctor Initializes a new instance of the `PercentageInterval`1\` class with default values. #### Syntax ```csharp theme={"dark"} public PercentageInterval() ``` ### .ctor Initializes a new instance of the `PercentageInterval`1\` class with the specified interval value and type. #### Syntax ```csharp theme={"dark"} public PercentageInterval(T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this interval references. | ### .ctor Initializes a new instance of the `PercentageInterval`1\` class with the specified rate, interval value, and type. #### Syntax ```csharp theme={"dark"} public PercentageInterval(System.Decimal money, T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `money` | `System.Decimal` | The percentage rate value that is calculated over the given interval. | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this interval references. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval(T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this Interval references. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Rate The amount of money represented by the given [IntervalType](/api-reference/CloudNimble/EasyAF/Core/IntervalType) #### Syntax ```csharp theme={"dark"} public System.Decimal Rate { get; set; } ``` #### Property Value Type: `System.Decimal` ### Type Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` The base unit that describes what the quantity of this Interval references. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Core.IntervalType Type { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Core.IntervalType` ### Value Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` The duration of the Interval. #### Syntax ```csharp theme={"dark"} public T Value { get; set; } ``` #### Property Value Type: `T` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PerDay Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay() ``` #### Returns Type: `System.Decimal` The number of occurrences per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerDay Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per day var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerDay = production.PerDay(100); // 1600 widgets per day (16 * 100) ``` ### PerHour Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour() ``` #### Returns Type: `System.Decimal` The number of occurrences per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerHour Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per hour var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerHour = production.PerHour(100); // 66.67 widgets per hour (1/1.5 * 100) ``` ### PerMinute Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute() ``` #### Returns Type: `System.Decimal` The number of occurrences per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Remarks If you need this as a whole number, wrap the result in [Decimal)](https://learn.microsoft.com/dotnet/api/system.math.floor\(system.decimal\)). ### PerMinute Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 90 minutes, total from 100 units of material per minute var production = new Interval<int>(90, IntervalType.Minutes); decimal totalPerMinute = production.PerMinute(100); // 1.11 widgets per minute (1/90 * 100) ``` ### PerMonth Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth() ``` #### Returns Type: `System.Decimal` The number of occurrences per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerMonth Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 3 days, total from 200 units of material per month var production = new Interval<int>(3, IntervalType.Days); decimal totalPerMonth = production.PerMonth(200); // 2000 widgets per month (10 * 200) ``` ### PerWeek Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek() ``` #### Returns Type: `System.Decimal` The number of occurrences per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerWeek Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 2 days, total from 50 units of material per week var production = new Interval<int>(2, IntervalType.Days); decimal totalPerWeek = production.PerWeek(50); // 175 widgets per week (3.5 * 50) ``` ### PerYear Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear() ``` #### Returns Type: `System.Decimal` The number of occurrences per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerYear Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1 week, total from 500 units of material per year var production = new Interval<int>(1, IntervalType.Weeks); decimal totalPerYear = production.PerYear(500); // 26071 widgets per year (52.14 * 500) ``` ### RatePerDay Calculates the total percentage rate per day based on the interval and rate. This method multiplies the interval frequency (how many intervals occur per day) by the rate value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerDay() ``` #### Returns Type: `System.Decimal` The total rate value per day as a decimal. #### Examples ```csharp theme={"dark"} // 8% rate every 6 hours = 0.08 * 4 = 0.32 rate per day var interval = new PercentageInterval<double>(0.08, 6, IntervalType.Hours); decimal ratePerDay = interval.RatePerDay(); ``` ### RatePerDay Calculates the total percentage rate per day for a given principal amount based on the interval and rate. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerDay(System.Decimal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Decimal` | The principal amount to apply the percentage rate to. | #### Returns Type: `System.Decimal` The total rate value per day as a decimal. #### Examples ```csharp theme={"dark"} // 8% growth rate every 6 hours, growth on $25,000 investment per day var growth = new PercentageInterval<double>(0.08m, 6, IntervalType.Hours); decimal growthPerDay = growth.RatePerDay(25000); // $8,000 per day ``` ### RatePerHour Calculates the total percentage rate per hour based on the interval and rate. This method multiplies the interval frequency (how many intervals occur per hour) by the rate value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerHour() ``` #### Returns Type: `System.Decimal` The total rate value per hour as a decimal. #### Examples ```csharp theme={"dark"} // 12% rate every 3 hours = 0.12 * (60/180) = 0.04 rate per hour var interval = new PercentageInterval<double>(0.12, 3, IntervalType.Hours); decimal ratePerHour = interval.RatePerHour(); ``` ### RatePerHour Calculates the total percentage rate per hour for a given principal amount based on the interval and rate. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerHour(System.Decimal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Decimal` | The principal amount to apply the percentage rate to. | #### Returns Type: `System.Decimal` The total rate value per hour as a decimal. #### Examples ```csharp theme={"dark"} // 12% growth rate every 3 hours, growth on $10,000 investment per hour var growth = new PercentageInterval<double>(0.12m, 3, IntervalType.Hours); decimal growthPerHour = growth.RatePerHour(10000); // $400 per hour ``` ### RatePerMinute Calculates the total percentage rate per minute based on the interval and rate. This method multiplies the interval frequency (how many intervals occur per minute) by the rate value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerMinute() ``` #### Returns Type: `System.Decimal` The total rate value per minute as a decimal. #### Examples ```csharp theme={"dark"} // 5% rate every 2 hours = 0.05 * (60/120) = 0.025 rate per minute var interval = new PercentageInterval<double>(0.05, 2, IntervalType.Hours); decimal ratePerMinute = interval.RatePerMinute(); ``` ### RatePerMinute Calculates the total percentage rate per minute for a given principal amount based on the interval and rate. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerMinute(System.Decimal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Decimal` | The principal amount to apply the percentage rate to. | #### Returns Type: `System.Decimal` The total rate value per minute as a decimal. #### Examples ```csharp theme={"dark"} // 2.5% interest every quarter, interest on $50,000 per minute var interest = new PercentageInterval<double>(0.025m, 3, IntervalType.Months); decimal interestPerMinute = interest.RatePerMinute(50000); // ~$0.19 per minute ``` ### RatePerMonth Calculates the total percentage rate per month based on the interval and rate. This method multiplies the interval frequency (how many intervals occur per month) by the rate value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerMonth() ``` #### Returns Type: `System.Decimal` The total rate value per month as a decimal. #### Examples ```csharp theme={"dark"} // 10% rate every 1 week = 0.10 * 4.34 = 0.434 rate per month var interval = new PercentageInterval<double>(0.10, 1, IntervalType.Weeks); decimal ratePerMonth = interval.RatePerMonth(); ``` ### RatePerMonth Calculates the total percentage rate per month for a given principal amount based on the interval and rate. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerMonth(System.Decimal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Decimal` | The principal amount to apply the percentage rate to. | #### Returns Type: `System.Decimal` The total rate value per month as a decimal. #### Examples ```csharp theme={"dark"} // 10% growth rate every week, growth on $5,000 investment per month var growth = new PercentageInterval<double>(0.10m, 1, IntervalType.Weeks); decimal growthPerMonth = growth.RatePerMonth(5000); // $2,170 per month ``` ### RatePerWeek Calculates the total percentage rate per week based on the interval and rate. This method multiplies the interval frequency (how many intervals occur per week) by the rate value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerWeek() ``` #### Returns Type: `System.Decimal` The total rate value per week as a decimal. #### Examples ```csharp theme={"dark"} // 15% rate every 2 days = 0.15 * 3.5 = 0.525 rate per week var interval = new PercentageInterval<double>(0.15, 2, IntervalType.Days); decimal ratePerWeek = interval.RatePerWeek(); ``` ### RatePerWeek Calculates the total percentage rate per week for a given principal amount based on the interval and rate. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerWeek(System.Decimal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Decimal` | The principal amount to apply the percentage rate to. | #### Returns Type: `System.Decimal` The total rate value per week as a decimal. #### Examples ```csharp theme={"dark"} // 15% discount rate every 2 days, discount on $1,000 purchase per week var discount = new PercentageInterval<double>(0.15m, 2, IntervalType.Days); decimal discountPerWeek = discount.RatePerWeek(1000); // $525 per week ``` ### RatePerYear Calculates the total percentage rate per year based on the interval and rate. This method multiplies the interval frequency (how many intervals occur per year) by the rate value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerYear() ``` #### Returns Type: `System.Decimal` The total rate value per year as a decimal. #### Examples ```csharp theme={"dark"} // 20% rate every 3 months = 0.20 * 4 = 0.80 rate per year var interval = new PercentageInterval<double>(0.20, 3, IntervalType.Months); decimal ratePerYear = interval.RatePerYear(); ``` ### RatePerYear Calculates the total percentage rate per year for a given principal amount based on the interval and rate. #### Syntax ```csharp theme={"dark"} public System.Decimal RatePerYear(System.Decimal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Decimal` | The principal amount to apply the percentage rate to. | #### Returns Type: `System.Decimal` The total rate value per year as a decimal. #### Examples ```csharp theme={"dark"} // 20% annual return every 3 months, return on $100,000 investment per year var returns = new PercentageInterval<double>(0.20m, 3, IntervalType.Months); decimal returnsPerYear = returns.RatePerYear(100000); // $80,000 per year ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Override Inherited from `CloudNimble.EasyAF.Core.Interval` #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # RatioInterval Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/RatioInterval Represents a ratio value that occurs at regular time intervals, enabling conversion between different time periods. This class combines a base time interval ... ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** CloudNimble.EasyAF.Core **Inheritance:** CloudNimble.EasyAF.Core.Interval\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Core.RatioInterval ``` ## Summary Represents a ratio value that occurs at regular time intervals, enabling conversion between different time periods. This class combines a base time interval (from the `Interval`1\` class) with a ratio value to calculate total ratio amounts across different time periods. ## Remarks \Key Concepts:\ \Method Types:\ \Common Use Cases:\ ## Examples ```csharp theme={"dark"} // Example: 70% conversion rate every 2 weeks var conversionInterval = new RatioInterval<double>(0.70, 2, IntervalType.Weeks); // How many 2-week intervals are there per month? decimal intervalsPerMonth = conversionInterval.PerMonth(); // ~2.17 intervals // What's the total conversion ratio per month? decimal totalConversionPerMonth = conversionInterval.RatioPerMonth(); // ~1.52 (0.70 × 2.17) // Daily breakdown decimal totalConversionPerDay = conversionInterval.RatioPerDay(); // ~0.05 (0.70 × 0.071) ``` ## Constructors ### .ctor Initializes a new instance of the `RatioInterval`1\` class with default values. #### Syntax ```csharp theme={"dark"} public RatioInterval() ``` ### .ctor Initializes a new instance of the `RatioInterval`1\` class with the specified interval value and type. #### Syntax ```csharp theme={"dark"} public RatioInterval(T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this interval references. | ### .ctor Initializes a new instance of the `RatioInterval`1\` class with the specified ratio, interval value, and type. #### Syntax ```csharp theme={"dark"} public RatioInterval(System.Decimal ratio, T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `ratio` | `System.Decimal` | The decimal ratio value that is calculated over the given interval. | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this interval references. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` Creates a new instance of the `Interval`1\` class. #### Syntax ```csharp theme={"dark"} public Interval(T value, CloudNimble.EasyAF.Core.IntervalType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `T` | The duration of the interval. | | `type` | `CloudNimble.EasyAF.Core.IntervalType` | The base unit that describes what the quantity of this Interval references. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Ratio Gets or sets the decimal ratio value that is calculated over the given interval. Can represent a ratio, rate, or other decimal value per time period. #### Syntax ```csharp theme={"dark"} public System.Decimal Ratio { get; set; } ``` #### Property Value Type: `System.Decimal` ### Type Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` The base unit that describes what the quantity of this Interval references. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Core.IntervalType Type { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Core.IntervalType` ### Value Inherited Inherited from `CloudNimble.EasyAF.Core.Interval` The duration of the Interval. #### Syntax ```csharp theme={"dark"} public T Value { get; set; } ``` #### Property Value Type: `T` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PerDay Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay() ``` #### Returns Type: `System.Decimal` The number of occurrences per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerDay Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per day. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerDay(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per day as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per day var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerDay = production.PerDay(100); // 1600 widgets per day (16 * 100) ``` ### PerHour Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour() ``` #### Returns Type: `System.Decimal` The number of occurrences per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerHour Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per hour. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerHour(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per hour as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours, total from 100 units of material per hour var production = new Interval<double>(1.5, IntervalType.Hours); decimal totalPerHour = production.PerHour(100); // 66.67 widgets per hour (1/1.5 * 100) ``` ### PerMinute Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute() ``` #### Returns Type: `System.Decimal` The number of occurrences per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Remarks If you need this as a whole number, wrap the result in [Decimal)](https://learn.microsoft.com/dotnet/api/system.math.floor\(system.decimal\)). ### PerMinute Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per minute. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMinute(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per minute as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 90 minutes, total from 100 units of material per minute var production = new Interval<int>(90, IntervalType.Minutes); decimal totalPerMinute = production.PerMinute(100); // 1.11 widgets per minute (1/90 * 100) ``` ### PerMonth Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth() ``` #### Returns Type: `System.Decimal` The number of occurrences per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerMonth Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per month. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerMonth(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per month as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 3 days, total from 200 units of material per month var production = new Interval<int>(3, IntervalType.Days); decimal totalPerMonth = production.PerMonth(200); // 2000 widgets per month (10 * 200) ``` ### PerWeek Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek() ``` #### Returns Type: `System.Decimal` The number of occurrences per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerWeek Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per week. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerWeek(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per week as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 2 days, total from 50 units of material per week var production = new Interval<int>(2, IntervalType.Days); decimal totalPerWeek = production.PerWeek(50); // 175 widgets per week (3.5 * 50) ``` ### PerYear Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance, calculates how many occurrences will happen per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear() ``` #### Returns Type: `System.Decimal` The number of occurrences per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | ### PerYear Inherited Virtual Inherited from `CloudNimble.EasyAF.Core.Interval` Given this `Interval`1\` instance and a quantity, calculates the total output per year. #### Syntax ```csharp theme={"dark"} public virtual System.Decimal PerYear(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to multiply by the interval frequency. | #### Returns Type: `System.Decimal` The total output per year as a decimal value. #### Exceptions | Exception | Description | | - | - | | `InvalidCastException` | Thrown if *T* is not convertible to a [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal). | #### Examples ```csharp theme={"dark"} // Widget production: 1 widget every 1 week, total from 500 units of material per year var production = new Interval<int>(1, IntervalType.Weeks); decimal totalPerYear = production.PerYear(500); // 26071 widgets per year (52.14 * 500) ``` ### RatioPerDay Calculates the total ratio value per day based on the interval and ratio. This method multiplies the interval frequency (how many intervals occur per day) by the ratio value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerDay() ``` #### Returns Type: `System.Decimal` The total ratio value per day as a decimal. #### Examples ```csharp theme={"dark"} // 0.75 ratio every 6 hours = 0.75 * 4 = 3.0 ratio per day var interval = new RatioInterval<double>(0.75, 6, IntervalType.Hours); decimal ratioPerDay = interval.RatioPerDay(); ``` ### RatioPerDay Calculates the total ratio value per day for a given quantity based on the interval and ratio. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerDay(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to apply the ratio calculation to. | #### Returns Type: `System.Decimal` The total ratio value per day as a decimal. #### Examples ```csharp theme={"dark"} // 70% conversion every month, total conversions from 30 customers per day var conversion = new RatioInterval<double>(0.70m, 1, IntervalType.Months); decimal conversionsPerDay = conversion.RatioPerDay(30); // ~0.69 conversions per day ``` ### RatioPerHour Calculates the total ratio value per hour based on the interval and ratio. This method multiplies the interval frequency (how many intervals occur per hour) by the ratio value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerHour() ``` #### Returns Type: `System.Decimal` The total ratio value per hour as a decimal. #### Examples ```csharp theme={"dark"} // 0.7 ratio every 1.5 hours = 0.7 * (60/90) = 0.467 ratio per hour var interval = new RatioInterval<double>(0.7, 1.5, IntervalType.Hours); decimal ratioPerHour = interval.RatioPerHour(); ``` ### RatioPerHour Calculates the total ratio value per hour for a given quantity based on the interval and ratio. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerHour(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to apply the ratio calculation to. | #### Returns Type: `System.Decimal` The total ratio value per hour as a decimal. #### Examples ```csharp theme={"dark"} // 70% conversion every 1.5 hours, total conversions from 100 leads per hour var conversion = new RatioInterval<double>(0.70m, 1.5, IntervalType.Hours); decimal conversionsPerHour = conversion.RatioPerHour(100); // ~46.67 conversions per hour ``` ### RatioPerMinute Calculates the total ratio value per minute based on the interval and ratio. This method multiplies the interval frequency (how many intervals occur per minute) by the ratio value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerMinute() ``` #### Returns Type: `System.Decimal` The total ratio value per minute as a decimal. #### Examples ```csharp theme={"dark"} // 0.5 ratio every 2 hours = 0.5 * (60/120) = 0.25 ratio per minute var interval = new RatioInterval<double>(0.5, 2, IntervalType.Hours); decimal ratioPerMinute = interval.RatioPerMinute(); ``` ### RatioPerMinute Calculates the total ratio value per minute for a given quantity based on the interval and ratio. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerMinute(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to apply the ratio calculation to. | #### Returns Type: `System.Decimal` The total ratio value per minute as a decimal. #### Examples ```csharp theme={"dark"} // 70% conversion every month, total conversions from 1000 leads per minute var conversion = new RatioInterval<double>(0.70m, 1, IntervalType.Months); decimal conversionsPerMinute = conversion.RatioPerMinute(1000); // ~0.016 conversions per minute ``` ### RatioPerMonth Calculates the total ratio value per month based on the interval and ratio. This method multiplies the interval frequency (how many intervals occur per month) by the ratio value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerMonth() ``` #### Returns Type: `System.Decimal` The total ratio value per month as a decimal. #### Examples ```csharp theme={"dark"} // 0.6 ratio every 1 week = 0.6 * 4.34 = 2.6 ratio per month var interval = new RatioInterval<double>(0.6, 1, IntervalType.Weeks); decimal ratioPerMonth = interval.RatioPerMonth(); ``` ### RatioPerMonth Calculates the total ratio value per month for a given quantity based on the interval and ratio. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerMonth(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to apply the ratio calculation to. | #### Returns Type: `System.Decimal` The total ratio value per month as a decimal. #### Examples ```csharp theme={"dark"} // 60% conversion every week, total conversions from 100 leads per month var conversion = new RatioInterval<double>(0.60m, 1, IntervalType.Weeks); decimal conversionsPerMonth = conversion.RatioPerMonth(100); // 260 conversions per month ``` ### RatioPerWeek Calculates the total ratio value per week based on the interval and ratio. This method multiplies the interval frequency (how many intervals occur per week) by the ratio value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerWeek() ``` #### Returns Type: `System.Decimal` The total ratio value per week as a decimal. #### Examples ```csharp theme={"dark"} // 0.8 ratio every 2 days = 0.8 * 3.5 = 2.8 ratio per week var interval = new RatioInterval<double>(0.8, 2, IntervalType.Days); decimal ratioPerWeek = interval.RatioPerWeek(); ``` ### RatioPerWeek Calculates the total ratio value per week for a given quantity based on the interval and ratio. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerWeek(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to apply the ratio calculation to. | #### Returns Type: `System.Decimal` The total ratio value per week as a decimal. #### Examples ```csharp theme={"dark"} // 80% conversion every 2 days, total conversions from 50 leads per week var conversion = new RatioInterval<double>(0.80m, 2, IntervalType.Days); decimal conversionsPerWeek = conversion.RatioPerWeek(50); // 140 conversions per week ``` ### RatioPerYear Calculates the total ratio value per year based on the interval and ratio. This method multiplies the interval frequency (how many intervals occur per year) by the ratio value. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerYear() ``` #### Returns Type: `System.Decimal` The total ratio value per year as a decimal. #### Examples ```csharp theme={"dark"} // 0.9 ratio every 3 months = 0.9 * 4 = 3.6 ratio per year var interval = new RatioInterval<double>(0.9, 3, IntervalType.Months); decimal ratioPerYear = interval.RatioPerYear(); ``` ### RatioPerYear Calculates the total ratio value per year for a given quantity based on the interval and ratio. #### Syntax ```csharp theme={"dark"} public System.Decimal RatioPerYear(System.Decimal quantity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `quantity` | `System.Decimal` | The quantity to apply the ratio calculation to. | #### Returns Type: `System.Decimal` The total ratio value per year as a decimal. #### Examples ```csharp theme={"dark"} // 90% conversion every 3 months, total conversions from 1000 leads per year var conversion = new RatioInterval<double>(0.90m, 3, IntervalType.Months); decimal conversionsPerYear = conversion.RatioPerYear(1000); // 3600 conversions per year ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Override Inherited from `CloudNimble.EasyAF.Core.Interval` #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Core/index Summary of the CloudNimble.EasyAF.Core Namespace ## Types ### Classes | Name | Summary | | - | - | | [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) | A base class for Entity Framework objects to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged), [IChangeTracking](https://learn.microsoft.com/dotnet/api/system.componentmodel.ichangetracking), and [IRevertibleChangeTracking](https://learn.microsoft.com/dotnet/api/system.componentmodel.irevertiblechangetracking) in front-end development. | | [EasyObservableObject](/api-reference/CloudNimble/EasyAF/Core/EasyObservableObject) | A base class for objects to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged). Provides strongly-typed property change notifications and automatic property setting with change detection. | | [Ensure](/api-reference/CloudNimble/EasyAF/Core/Ensure) | Provides methods for ensuring that method arguments meet specific criteria. This class provides a consistent way to validate arguments and throw appropriate exceptions. | | [HttpHandlerMode](/api-reference/CloudNimble/EasyAF/Core/HttpHandlerMode) | Specifies how HttpClient message handlers should be configured when registering HTTP clients. Determines whether handlers are added to existing handlers or replace them entirely. | | [IIdentifiableEqualityComparer](/api-reference/CloudNimble/EasyAF/Core/IIdentifiableEqualityComparer) | Provides an equality comparer for objects that implement `IIdentifiable`1\`. Compares objects based on their Id property values for equality and hash code generation. | | [Interval](/api-reference/CloudNimble/EasyAF/Core/Interval) | Describes an interval of time to be used in time-based calculations. Provides methods to calculate rates and frequencies based on the interval value and type. | | [IntervalType](/api-reference/CloudNimble/EasyAF/Core/IntervalType) | Specifies the type of interval duration. | | [MoneyInterval](/api-reference/CloudNimble/EasyAF/Core/MoneyInterval) | Represents a sum of money to be exchanged during a given interval. | | [NameOf](/api-reference/CloudNimble/EasyAF/Core/NameOf) | Fills a gap in `nameof` by allowing you to use deep name references instead of local name references. | | [PercentageInterval](/api-reference/CloudNimble/EasyAF/Core/PercentageInterval) | Represents a percentage rate that occurs at regular time intervals, enabling conversion between different time periods. This class combines a base time interval (from the `Interval`1\` class) with a percentage rate to calculate total percentage amounts across different time periods. | | [RatioInterval](/api-reference/CloudNimble/EasyAF/Core/RatioInterval) | Represents a ratio value that occurs at regular time intervals, enabling conversion between different time periods. This class combines a base time interval (from the `Interval`1\` class) with a ratio value to calculate total ratio amounts across different time periods. | ### Interfaces | Name | Summary | | - | - | | [IActiveTrackable](/api-reference/CloudNimble/EasyAF/Core/IActiveTrackable) | An interface that implements the CloudNimble common pattern for tracking who created an Entity. | | [ICreatedAuditable](/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable) | An interface that implements the CloudNimble common pattern for tracking who created an Entity. | | [ICreatorTrackable](/api-reference/CloudNimble/EasyAF/Core/ICreatorTrackable) | An interface that implements the CloudNimble common pattern for tracking who created an Entity. | | [IDbEnum](/api-reference/CloudNimble/EasyAF/Core/IDbEnum) | An interface that represents the CloudNimble database-driven enumeration pattern that lets you update the Enum as processes change without changing the meaning of Entities that are linked to the older enums. | | [IDbStateEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStateEnum) | An interface that identifies this Entity as being the enumeration details for the SimpleStateMachine. | | [IDbStatusEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStatusEnum) | An interface that identifies this Entity as being the enumeration details for the SimpleStateMachine. | | [IHasState](/api-reference/CloudNimble/EasyAF/Core/IHasState) | An interface that specifes an implementing Entity changes State as part of the SimpleStateMachine. | | [IHasStatus](/api-reference/CloudNimble/EasyAF/Core/IHasStatus) | An interface that specifes an implementing Entity contains a child Entity of T that implements [IDbStatusEnum](/api-reference/CloudNimble/EasyAF/Core/IDbStatusEnum) and represents the Entity's current status. | | [IHumanReadable](/api-reference/CloudNimble/EasyAF/Core/IHumanReadable) | An interface that specifies the implementing Entity displays text to the user. | | [IIdentifiable](/api-reference/CloudNimble/EasyAF/Core/IIdentifiable) | An interface that guarantees a particular Entity contains an "Id" property with a type *T*. | | [ISortable](/api-reference/CloudNimble/EasyAF/Core/ISortable) | An interface that specifies the implementing Entity can be contains an [Int32](https://learn.microsoft.com/dotnet/api/system.int32) that tracks the order items should be displayed in a list. | | [IUpdatedAuditable](/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable) | An interface that implements the CloudNimble common pattern for tracking who created an Entity. | | [IUpdaterTrackable](/api-reference/CloudNimble/EasyAF/Core/IUpdaterTrackable) | An interface that implements the CloudNimble common pattern for tracking who updated an Entity. | ### Enums | Name | Summary | | - | - | | [HttpHandlerMode](/api-reference/CloudNimble/EasyAF/Core/HttpHandlerMode) | Specifies how HttpClient message handlers should be configured when registering HTTP clients. Determines whether handlers are added to existing handlers or replace them entirely. | | [IntervalType](/api-reference/CloudNimble/EasyAF/Core/IntervalType) | Specifies the type of interval duration. | # AzureActiveDirectorySqlAuthProvider Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Data/AzureActiveDirectorySqlAuthProvider Provides a custom authentication method that gets a [SqlAuthenticationToken](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlauthenticatio... ## Definition **Assembly:** CloudNimble.EasyAF.Data.EF6.dll **Namespace:** CloudNimble.EasyAF.Data **Inheritance:** Microsoft.Data.SqlClient.SqlAuthenticationProvider ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Data.AzureActiveDirectorySqlAuthProvider ``` ## Summary Provides a custom authentication method that gets a [SqlAuthenticationToken](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlauthenticationtoken) from Azure Identity for the executing context. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public AzureActiveDirectorySqlAuthProvider() ``` ## Methods ### AcquireTokenAsync Override Request token from the provider using the specified [SqlAuthenticationParameters](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlauthenticationparameters). Uses DefaultAzureCredential to obtain an access token for SQL Database authentication. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task AcquireTokenAsync(Microsoft.Data.SqlClient.SqlAuthenticationParameters parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `parameters` | `Microsoft.Data.SqlClient.SqlAuthenticationParameters` | The authentication parameters from SQL Client. | #### Returns Type: `System.Threading.Tasks.Task` A SqlAuthenticationToken containing the access token and expiration time. ### IsSupported Override Returns a flag indicating if the requested [SqlAuthenticationMethod](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlauthenticationmethod) is supported by this custom [SqlAuthenticationProvider](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlauthenticationprovider). This provider supports ActiveDirectoryDeviceCodeFlow authentication method. #### Syntax ```csharp theme={"dark"} public override bool IsSupported(Microsoft.Data.SqlClient.SqlAuthenticationMethod authenticationMethod) ``` #### Parameters | Name | Type | Description | | - | - | - | | `authenticationMethod` | `Microsoft.Data.SqlClient.SqlAuthenticationMethod` | The authentication method to check for support. | #### Returns Type: `bool` True if the authentication method is ActiveDirectoryDeviceCodeFlow; otherwise, false. # EasyAFSqlAzureConfiguration Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Data/EasyAFSqlAzureConfiguration Provides Entity Framework 6 configuration optimized for SQL Azure connections. Configures Microsoft.Data.SqlClient provider and Azure-specific execution stra... ## Definition **Assembly:** CloudNimble.EasyAF.Data.EF6.dll **Namespace:** CloudNimble.EasyAF.Data **Inheritance:** System.Data.Entity.DbConfiguration ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Data.EasyAFSqlAzureConfiguration ``` ## Summary Provides Entity Framework 6 configuration optimized for SQL Azure connections. Configures Microsoft.Data.SqlClient provider and Azure-specific execution strategy for improved reliability. ## Constructors ### .ctor Initializes a new instance of the EasyAFSqlAzureConfiguration class. Configures the SQL provider factory, services, and execution strategy for SQL Azure. #### Syntax ```csharp theme={"dark"} public EasyAFSqlAzureConfiguration() ``` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Data/index Summary of the CloudNimble.EasyAF.Data Namespace ## Types ### Classes | Name | Summary | | - | - | | [AzureActiveDirectorySqlAuthProvider](/api-reference/CloudNimble/EasyAF/Data/AzureActiveDirectorySqlAuthProvider) | Provides a custom authentication method that gets a [SqlAuthenticationToken](https://learn.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlauthenticationtoken) from Azure Identity for the executing context. | | [EasyAFSqlAzureConfiguration](/api-reference/CloudNimble/EasyAF/Data/EasyAFSqlAzureConfiguration) | Provides Entity Framework 6 configuration optimized for SQL Azure connections. Configures Microsoft.Data.SqlClient provider and Azure-specific execution strategy for improved reliability. | # DualHttpContextAccessor Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor [IHttpContextAccessor](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor) that keeps an outer request and an inner in-pro... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.DualHttpContextAccessor ``` ## Summary [IHttpContextAccessor](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor) that keeps an outer request and an inner in-process request as two contexts. [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) always returns [DualHttpContextAccessor.Active](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#active). `HttpContext)` / [DualHttpContextAccessor.End](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#end) change which context is active without using Microsoft's `HttpContextAccessor` setter (that setter nulls a shared holder and ends the outer request). ## Remarks Register this as [IHttpContextAccessor](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor) after `AddHttpContextAccessor` so last-wins DI gives the rest of the pipeline this instance. Host `Initialize` assigns [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) (sets [DualHttpContextAccessor.Outer](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#outer) and [DualHttpContextAccessor.Active](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#active)). Inner execute calls `HttpContext)`, then [DualHttpContextAccessor.End](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#end) in `finally`. Host `Dispose` assigns [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), which poisons the holder so every execution context sees request-end. ## Examples ```csharp theme={"dark"} accessor.HttpContext = incomingRequest; InnerHttpContext.CopyFromOuter(innerRequest, incomingRequest); accessor.Start(innerRequest); try { await pipeline(innerRequest); } finally { accessor.End(); } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DualHttpContextAccessor() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Active Gets the context [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) returns. `HttpContext)` and [DualHttpContextAccessor.End](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#end) change this without using the setter. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Http.HttpContext Active { get; } ``` #### Property Value Type: `Microsoft.AspNetCore.Http.HttpContext` ### HttpContext #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Http.HttpContext HttpContext { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Http.HttpContext` ### Inner Gets the inner in-process context, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if `HttpContext)` has not run or [DualHttpContextAccessor.End](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#end) / request-end has already cleared it. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Http.HttpContext Inner { get; } ``` #### Property Value Type: `Microsoft.AspNetCore.Http.HttpContext` ### Outer Gets the incoming (outer) context, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if the host has not assigned [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) yet. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Http.HttpContext Outer { get; } ``` #### Property Value Type: `Microsoft.AspNetCore.Http.HttpContext` ## Methods ### End Makes [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) return [DualHttpContextAccessor.Outer](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#outer) again and clears [DualHttpContextAccessor.Inner](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#inner). Does not write to [DualHttpContextAccessor.Outer](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#outer)'s response. #### Syntax ```csharp theme={"dark"} public void End() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Start Makes [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) return *inner* without dropping [DualHttpContextAccessor.Outer](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#outer). Do not use the [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) setter for this. #### Syntax ```csharp theme={"dark"} public void Start(Microsoft.AspNetCore.Http.HttpContext inner) ``` #### Parameters | Name | Type | Description | | - | - | - | | `inner` | `Microsoft.AspNetCore.Http.HttpContext` | The inner in-process request. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *inner* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.AspNetCore.Http.IHttpContextAccessor # InnerHttpContext Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/InnerHttpContext Copies origin, identity, and headers from an outer [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext) onto an inner ... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.InnerHttpContext ``` ## Summary Copies origin, identity, and headers from an outer [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext) onto an inner in-process request so the inner pipeline sees the public URL and the same user. ## Remarks The caller constructs the inner [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext) (typically `new DefaultHttpContext()` in an ASP.NET Core app, or [IFeatureCollection)](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextfactory.create\(microsoft.aspnetcore.http.features.ifeaturecollection\))). This type stays on `Microsoft.AspNetCore.Http.Abstractions` and does not construct a context. ## Examples ```csharp theme={"dark"} var inner = new DefaultHttpContext { RequestServices = scope.ServiceProvider, RequestAborted = cancellationToken }; InnerHttpContext.CopyFromOuter(inner, outer); InnerHttpContext.ConfigureRequest(inner, "GET", "/odata/Customers", QueryString.Empty); inner.Request.Headers["Accept"] = "application/json"; inner.Response.Body = new MemoryStream(); ``` ## Methods ### ConfigureRequest Sets method, path, and query on *inner*, and optionally replaces the request body. #### Syntax ```csharp theme={"dark"} public static void ConfigureRequest(Microsoft.AspNetCore.Http.HttpContext inner, string method, string path, Microsoft.AspNetCore.Http.QueryString query, System.IO.Stream body = null, string contentType = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `inner` | `Microsoft.AspNetCore.Http.HttpContext` | The inner context to configure. | | `method` | `string` | The HTTP method, for example `GET`. | | `path` | `string` | The request path, including a leading slash. | | `query` | `Microsoft.AspNetCore.Http.QueryString` | The query string, or [Empty](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.querystring.empty). | | `body` | `System.IO.Stream` | An optional replacement request body. When [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), the body is left unchanged. | | `contentType` | `string` | The content type to set when *body* is provided. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *inner* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | | `ArgumentException` | Thrown when *method* or *path* is blank. | ### CopyFromOuter Copies scheme, host, path base, user, and non-skipped headers from *outer* onto *inner*. When *outer* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), uses `http` / `localhost` and an empty principal. #### Syntax ```csharp theme={"dark"} public static void CopyFromOuter(Microsoft.AspNetCore.Http.HttpContext inner, Microsoft.AspNetCore.Http.HttpContext outer) ``` #### Parameters | Name | Type | Description | | - | - | - | | `inner` | `Microsoft.AspNetCore.Http.HttpContext` | The inner context to fill. | | `outer` | `Microsoft.AspNetCore.Http.HttpContext` | The incoming context, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when there is no outer request. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *inner* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | #### Remarks Scheme, host, and path base come from the outer request so generated links match the public URL. Other request headers are copied except hop-by-hop, entity-body, and HTTP conditionals (see [InnerHttpContext.SkippedRequestHeaders](/api-reference/CloudNimble/EasyAF/Http/InnerHttpContext#skippedrequestheaders)). ### CopyIncomingHeaders Copies outer request headers onto the inner call, skipping [InnerHttpContext.SkippedRequestHeaders](/api-reference/CloudNimble/EasyAF/Http/InnerHttpContext#skippedrequestheaders). #### Syntax ```csharp theme={"dark"} public static void CopyIncomingHeaders(Microsoft.AspNetCore.Http.HttpContext inner, Microsoft.AspNetCore.Http.HttpContext outer) ``` #### Parameters | Name | Type | Description | | - | - | - | | `inner` | `Microsoft.AspNetCore.Http.HttpContext` | The inner context. | | `outer` | `Microsoft.AspNetCore.Http.HttpContext` | The incoming context. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *inner* or *outer* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | # ODataConstants Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataConstants A set of constants that specify different string values that OData uses. ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataConstants ``` ## Summary A set of constants that specify different string values that OData uses. # ODataV401List Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401List Represents an OData v4.01 collection response containing a list of entities with optional pagination metadata. Uses simplified OData v4.01 notation for conte... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV401List ``` ## Summary Represents an OData v4.01 collection response containing a list of entities with optional pagination metadata. Uses simplified OData v4.01 notation for context and metadata properties. ## Type Parameters * `T` - The type of entities in the collection. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV401List() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase` #### Syntax ```csharp theme={"dark"} public ODataV401ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Items Gets or sets the collection of entities returned by the OData v4.01 service. This property contains the actual data payload of the response. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Items { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### ODataContext Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase` Gets or sets the OData context URL that describes the payload using OData v4.01 simplified notation. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ### ODataCount Gets or sets the total number of entities in the collection using OData v4.01 simplified count notation. This property is only populated when the \$count query option is used. #### Syntax ```csharp theme={"dark"} public long ODataCount { get; set; } ``` #### Property Value Type: `long` ### ODataNextLink Gets or sets the URL for retrieving the next page of results using OData v4.01 simplified notation. This property is null if there are no more pages available. #### Syntax ```csharp theme={"dark"} public string ODataNextLink { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV401PrimitiveResult Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401PrimitiveResult A container that allows you to capture metadata from an OData V4 response. ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV401PrimitiveResult ``` ## Summary A container that allows you to capture metadata from an OData V4 response. ## Type Parameters * `T` - The type that will be deserialized from the OData V4 "value" property. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV401PrimitiveResult() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase` #### Syntax ```csharp theme={"dark"} public ODataV401ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ODataContext Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase` Gets or sets the OData context URL that describes the payload using OData v4.01 simplified notation. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ### Value Gets or sets the primitive value returned by the OData v4.01 service. This property contains the actual data payload for primitive type responses. #### Syntax ```csharp theme={"dark"} public T Value { get; set; } ``` #### Property Value Type: `T` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV401ResponseBase Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401ResponseBase Represents the base class for OData v4.01 responses containing common OData metadata properties. Provides the foundation for strongly-typed OData v4.01 respo... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase ``` ## Summary Represents the base class for OData v4.01 responses containing common OData metadata properties. Provides the foundation for strongly-typed OData v4.01 response handling with simplified context notation. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV401ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ODataContext Gets or sets the OData context URL that describes the payload using OData v4.01 simplified notation. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV401SingleEntityResponseBase Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401SingleEntityResponseBase Represents the base class for OData v4.01 single entity responses containing entity-specific metadata. Uses simplified OData v4.01 notation for entity type i... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV401SingleEntityResponseBase ``` ## Summary Represents the base class for OData v4.01 single entity responses containing entity-specific metadata. Uses simplified OData v4.01 notation for entity type information and identification. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV401SingleEntityResponseBase() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase` #### Syntax ```csharp theme={"dark"} public ODataV401ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ODataContext Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV401ResponseBase` Gets or sets the OData context URL that describes the payload using OData v4.01 simplified notation. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ### ODataEditLink Gets or sets the URL that can be used to edit the entity using OData v4.01 simplified notation. This property provides the endpoint for performing update operations on the entity. #### Syntax ```csharp theme={"dark"} public string ODataEditLink { get; set; } ``` #### Property Value Type: `string` ### ODataId Gets or sets the canonical URL that identifies the entity using OData v4.01 simplified notation. This property provides a unique identifier for the entity resource. #### Syntax ```csharp theme={"dark"} public string ODataId { get; set; } ``` #### Property Value Type: `string` ### ODataType Gets or sets the type annotation specifying the entity type using OData v4.01 simplified notation. This property provides runtime type information for the entity. #### Syntax ```csharp theme={"dark"} public string ODataType { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4Error Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4Error Represents an OData error payload. ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4Error ``` ## Summary Represents an OData error payload. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4Error() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Code Gets or sets the error code to be used in payloads. #### Syntax ```csharp theme={"dark"} public string Code { get; set; } ``` #### Property Value Type: `string` ### Details Gets or sets a collection of additional error details providing more specific information about the error. This property may contain multiple error details for scenarios with multiple validation failures. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Details { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### InnerError \>Gets or sets the implementation-specific debugging information to help determine the cause of the error. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Http.OData.ODataV4InnerError InnerError { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Http.OData.ODataV4InnerError` ### Message Gets or sets the error message. #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string` ### Target Gets or sets the target of the particular error. #### Syntax ```csharp theme={"dark"} public string Target { get; set; } ``` #### Property Value Type: `string` #### Remarks For example, the name of the property in error. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4ErrorDetail Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ErrorDetail Represents more details about an OData error. ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4ErrorDetail ``` ## Summary Represents more details about an OData error. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4ErrorDetail() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Code Gets or sets the error code to be used in payloads. #### Syntax ```csharp theme={"dark"} public string Code { get; set; } ``` #### Property Value Type: `string` ### Message Gets or sets the error message. #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string` ### Target Gets or sets the target of the particular error. #### Syntax ```csharp theme={"dark"} public string Target { get; set; } ``` #### Property Value Type: `string` #### Remarks For example, the name of the property in error. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4ErrorResponse Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ErrorResponse The wrapper around an [ODataV4Error](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4Error) returned from an OData service. ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4ErrorResponse ``` ## Summary The wrapper around an [ODataV4Error](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4Error) returned from an OData service. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4ErrorResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Error Gets or sets the OData error information returned from the service. Contains detailed error information including code, message, and optional debugging details. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Http.OData.ODataV4Error Error { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Http.OData.ODataV4Error` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4InnerError Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4InnerError Represents implementation-specific debugging information for OData errors. Contains detailed error information such as exception details, stack traces, and n... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4InnerError ``` ## Summary Represents implementation-specific debugging information for OData errors. Contains detailed error information such as exception details, stack traces, and nested errors. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4InnerError() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerError Gets or sets nested inner error information for chained exceptions. This property allows for hierarchical error reporting when multiple exceptions are involved. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Http.OData.ODataV4InnerError InnerError { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.Http.OData.ODataV4InnerError` ### Message Gets or sets the detailed error message providing implementation-specific information about the error. This message is typically more technical than the outer error message. #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string` ### StackTrace Gets or sets the stack trace information for debugging purposes. This property provides detailed execution path information when the error occurred. #### Syntax ```csharp theme={"dark"} public string StackTrace { get; set; } ``` #### Property Value Type: `string` ### TypeName Gets or sets the type name of the exception that caused the error. This property helps identify the specific type of error that occurred on the server. #### Syntax ```csharp theme={"dark"} public string TypeName { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4List Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4List Represents an OData v4.0 collection response containing a list of entities with optional pagination metadata. Provides strongly-typed access to collection da... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4List ``` ## Summary Represents an OData v4.0 collection response containing a list of entities with optional pagination metadata. Provides strongly-typed access to collection data with count and next link information. ## Type Parameters * `T` - The type of entities in the collection. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4List() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase` #### Syntax ```csharp theme={"dark"} public ODataV4ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Items Gets or sets the collection of entities returned by the OData service. This property contains the actual data payload of the response. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Items { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### ODataContext Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase` Gets or sets the OData context URL that describes the payload. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ### ODataCount Gets or sets the total number of entities in the collection, regardless of pagination. This property is only populated when the \$count query option is used. #### Syntax ```csharp theme={"dark"} public long ODataCount { get; set; } ``` #### Property Value Type: `long` ### ODataNextLink Gets or sets the URL for retrieving the next page of results when server-side paging is enabled. This property is null if there are no more pages available. #### Syntax ```csharp theme={"dark"} public string ODataNextLink { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4PrimitiveResult Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4PrimitiveResult A container that allows you to capture metadata from an OData V4 response. ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4PrimitiveResult ``` ## Summary A container that allows you to capture metadata from an OData V4 response. ## Type Parameters * `T` - The type that will be deserialized from the OData V4 "value" property. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4PrimitiveResult() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase` #### Syntax ```csharp theme={"dark"} public ODataV4ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ODataContext Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase` Gets or sets the OData context URL that describes the payload. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ### Value Gets or sets the primitive value returned by the OData service. This property contains the actual data payload for primitive type responses. #### Syntax ```csharp theme={"dark"} public T Value { get; set; } ``` #### Property Value Type: `T` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4ResponseBase Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ResponseBase Represents the base class for OData v4.0 responses containing common OData metadata properties. Provides the foundation for strongly-typed OData response han... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase ``` ## Summary Represents the base class for OData v4.0 responses containing common OData metadata properties. Provides the foundation for strongly-typed OData response handling. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ODataContext Gets or sets the OData context URL that describes the payload. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4ResultList Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ResultList A container for deserializing an OData v4 result and its associated metadata. ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4ResultList ``` ## Summary A container for deserializing an OData v4 result and its associated metadata. ## Type Parameters * `T` - The type of Items in the OData payload. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4ResultList() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ExpectedItemCount Maps to the "odata.count" property. #### Syntax ```csharp theme={"dark"} public string ExpectedItemCount { get; set; } ``` #### Property Value Type: `string` #### Remarks A mismatch between `ExpectedItemCount` and `Items`.Count can indicate an issue with deserialization. ### Items A [List\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) containing the items returned from the service. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Items { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### MetadataReferenceLink Maps to the "@odata.context" property, and specifies which item in the model metadata is being returned. #### Syntax ```csharp theme={"dark"} public string MetadataReferenceLink { get; set; } ``` #### Property Value Type: `string` ### NextPageLink Maps to the "@odata.nextLink" property, and specifies the URL to call to get the next page of results. #### Syntax ```csharp theme={"dark"} public string NextPageLink { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataV4SingleEntityResponseBase Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4SingleEntityResponseBase Represents the base class for OData v4.0 single entity responses containing entity-specific metadata. Provides properties for entity type information, identi... ## Definition **Assembly:** CloudNimble.EasyAF.Http.dll **Namespace:** CloudNimble.EasyAF.Http.OData **Inheritance:** CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Http.OData.ODataV4SingleEntityResponseBase ``` ## Summary Represents the base class for OData v4.0 single entity responses containing entity-specific metadata. Provides properties for entity type information, identification, and edit links. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataV4SingleEntityResponseBase() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase` #### Syntax ```csharp theme={"dark"} public ODataV4ResponseBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ODataContext Inherited Inherited from `CloudNimble.EasyAF.Http.OData.ODataV4ResponseBase` Gets or sets the OData context URL that describes the payload. This metadata property provides information about the entity set, type, and other context details. #### Syntax ```csharp theme={"dark"} public string ODataContext { get; set; } ``` #### Property Value Type: `string` ### ODataEditLink Gets or sets the URL that can be used to edit the entity. This property provides the endpoint for performing update operations on the entity. #### Syntax ```csharp theme={"dark"} public string ODataEditLink { get; set; } ``` #### Property Value Type: `string` ### ODataId Gets or sets the canonical URL that identifies the entity. This property provides a unique identifier for the entity resource. #### Syntax ```csharp theme={"dark"} public string ODataId { get; set; } ``` #### Property Value Type: `string` ### ODataIdType Gets or sets the type annotation for the entity's Id property. This property specifies the data type of the entity identifier. #### Syntax ```csharp theme={"dark"} public string ODataIdType { get; set; } ``` #### Property Value Type: `string` ### ODataType Gets or sets the type annotation specifying the entity type. This property provides runtime type information for the entity. #### Syntax ```csharp theme={"dark"} public string ODataType { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/OData/index Summary of the CloudNimble.EasyAF.Http.OData Namespace ## Types ### Classes | Name | Summary | | - | - | | [ODataConstants](/api-reference/CloudNimble/EasyAF/Http/OData/ODataConstants) | A set of constants that specify different string values that OData uses. | | [ODataV401List](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401List) | Represents an OData v4.01 collection response containing a list of entities with optional pagination metadata. Uses simplified OData v4.01 notation for context and metadata properties. | | [ODataV401PrimitiveResult](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401PrimitiveResult) | A container that allows you to capture metadata from an OData V4 response. | | [ODataV401ResponseBase](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401ResponseBase) | Represents the base class for OData v4.01 responses containing common OData metadata properties. Provides the foundation for strongly-typed OData v4.01 response handling with simplified context notation. | | [ODataV401SingleEntityResponseBase](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV401SingleEntityResponseBase) | Represents the base class for OData v4.01 single entity responses containing entity-specific metadata. Uses simplified OData v4.01 notation for entity type information and identification. | | [ODataV4Error](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4Error) | Represents an OData error payload. | | [ODataV4ErrorDetail](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ErrorDetail) | Represents more details about an OData error. | | [ODataV4ErrorResponse](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ErrorResponse) | The wrapper around an [ODataV4Error](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4Error) returned from an OData service. | | [ODataV4InnerError](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4InnerError) | Represents implementation-specific debugging information for OData errors. Contains detailed error information such as exception details, stack traces, and nested errors. | | [ODataV4List](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4List) | Represents an OData v4.0 collection response containing a list of entities with optional pagination metadata. Provides strongly-typed access to collection data with count and next link information. | | [ODataV4PrimitiveResult](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4PrimitiveResult) | A container that allows you to capture metadata from an OData V4 response. | | [ODataV4ResponseBase](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ResponseBase) | Represents the base class for OData v4.0 responses containing common OData metadata properties. Provides the foundation for strongly-typed OData response handling. | | [ODataV4ResultList](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4ResultList) | A container for deserializing an OData v4 result and its associated metadata. | | [ODataV4SingleEntityResponseBase](/api-reference/CloudNimble/EasyAF/Http/OData/ODataV4SingleEntityResponseBase) | Represents the base class for OData v4.0 single entity responses containing entity-specific metadata. Provides properties for entity type information, identification, and edit links. | # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Http/index Summary of the CloudNimble.EasyAF.Http Namespace ## Types ### Classes | Name | Summary | | - | - | | [DualHttpContextAccessor](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor) | [IHttpContextAccessor](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor) that keeps an outer request and an inner in-process request as two contexts. [DualHttpContextAccessor.HttpContext](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#httpcontext) always returns [DualHttpContextAccessor.Active](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#active). `HttpContext)` / [DualHttpContextAccessor.End](/api-reference/CloudNimble/EasyAF/Http/DualHttpContextAccessor#end) change which context is active without using Microsoft's `HttpContextAccessor` setter (that setter nulls a shared holder and ends the outer request). | | [InnerHttpContext](/api-reference/CloudNimble/EasyAF/Http/InnerHttpContext) | Copies origin, identity, and headers from an outer [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext) onto an inner in-process request so the inner pipeline sees the public URL and the same user. | # ItemBuilder Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/MSBuild/ItemBuilder Builder class for configuring individual MSBuild items in a fluent manner. ## Definition **Assembly:** CloudNimble.EasyAF.MSBuild.dll **Namespace:** CloudNimble.EasyAF.MSBuild **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.MSBuild.ItemBuilder ``` ## Summary Builder class for configuring individual MSBuild items in a fluent manner. ## Remarks This class provides a fluent API for adding metadata to MSBuild items. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### AddMetadata Adds metadata to the item. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.ItemBuilder AddMetadata(string name, string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The metadata name. | | `value` | `string` | The metadata value. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.ItemBuilder` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when name or value is null or whitespace. | ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetLink Sets the Link metadata for the item (commonly used with AdditionalFiles). #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.ItemBuilder SetLink(string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `string` | The Link value. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.ItemBuilder` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when value is null or whitespace. | ### SetPrivateAssets Sets the PrivateAssets metadata for the item (commonly used with PackageReference). #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.ItemBuilder SetPrivateAssets(string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `string` | The PrivateAssets value (e.g., "all", "runtime", "compile"). | #### Returns Type: `CloudNimble.EasyAF.MSBuild.ItemBuilder` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when value is null or whitespace. | ### SetVisible Sets the Visible metadata for the item. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.ItemBuilder SetVisible(bool visible) ``` #### Parameters | Name | Type | Description | | - | - | - | | `visible` | `bool` | Whether the item should be visible. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.ItemBuilder` The current instance for method chaining. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ItemGroupBuilder Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/MSBuild/ItemGroupBuilder Builder class for configuring MSBuild ItemGroups in a fluent manner. ## Definition **Assembly:** CloudNimble.EasyAF.MSBuild.dll **Namespace:** CloudNimble.EasyAF.MSBuild **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.MSBuild.ItemGroupBuilder ``` ## Summary Builder class for configuring MSBuild ItemGroups in a fluent manner. ## Remarks This class provides a fluent API for adding items to MSBuild ItemGroups, making it easier to construct complex project structures programmatically. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### AddAdditionalFiles Adds an AdditionalFiles item to the ItemGroup. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.ItemBuilder AddAdditionalFiles(string include) ``` #### Parameters | Name | Type | Description | | - | - | - | | `include` | `string` | The file pattern to include. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.ItemBuilder` An ItemBuilder for further configuration of the AdditionalFiles item. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when include is null or whitespace. | ### AddItem Adds a generic item to the ItemGroup. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.ItemBuilder AddItem(string itemType, string include) ``` #### Parameters | Name | Type | Description | | - | - | - | | `itemType` | `string` | The type of the item. | | `include` | `string` | The include value for the item. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.ItemBuilder` An ItemBuilder for further configuration of the item. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when itemType or include is null or whitespace. | ### AddPackageReference Adds a PackageReference item to the ItemGroup. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.ItemBuilder AddPackageReference(string packageId, string version) ``` #### Parameters | Name | Type | Description | | - | - | - | | `packageId` | `string` | The package ID. | | `version` | `string` | The package version. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.ItemBuilder` An ItemBuilder for further configuration of the PackageReference. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when packageId or version is null or whitespace. | ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # MSBuildProjectManager Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/MSBuild/MSBuildProjectManager Manages MSBuild project files (.csproj, Directory.Build.props, etc.) with formatting preservation capabilities. ## Definition **Assembly:** CloudNimble.EasyAF.MSBuild.dll **Namespace:** CloudNimble.EasyAF.MSBuild **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.MSBuild.MSBuildProjectManager ``` ## Summary Manages MSBuild project files (.csproj, Directory.Build.props, etc.) with formatting preservation capabilities. ## Remarks This class provides comprehensive support for loading, validating, and modifying MSBuild project files while preserving the original formatting (indentation, line breaks). It follows the same pattern as DocsJsonManager for consistency. ## Constructors ### .ctor Initializes a new instance of the [MSBuildProjectManager](/api-reference/CloudNimble/EasyAF/MSBuild/MSBuildProjectManager) class. #### Syntax ```csharp theme={"dark"} public MSBuildProjectManager() ``` ### .ctor Initializes a new instance of the [MSBuildProjectManager](/api-reference/CloudNimble/EasyAF/MSBuild/MSBuildProjectManager) class with the specified file path. #### Syntax ```csharp theme={"dark"} public MSBuildProjectManager(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to the MSBuild project file. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when filePath is null or whitespace. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### FilePath Gets the file path of the loaded project. #### Syntax ```csharp theme={"dark"} public string FilePath { get; private set; } ``` #### Property Value Type: `string` The absolute path to the project file that was loaded or will be saved to. Returns null if no file path has been specified. ### IsLoaded Gets a value indicating whether a project is successfully loaded. #### Syntax ```csharp theme={"dark"} public bool IsLoaded { get; } ``` #### Property Value Type: `bool` True if a project is loaded and there are no errors; otherwise, false. ### PreserveFormatting Gets a value indicating whether formatting preservation is enabled. #### Syntax ```csharp theme={"dark"} public bool PreserveFormatting { get; private set; } ``` #### Property Value Type: `bool` True if the project was loaded with formatting preservation; otherwise, false. ### Project Gets the loaded MSBuild project root element. #### Syntax ```csharp theme={"dark"} public Microsoft.Build.Construction.ProjectRootElement Project { get; private set; } ``` #### Property Value Type: `Microsoft.Build.Construction.ProjectRootElement` The [ProjectRootElement](https://learn.microsoft.com/dotnet/api/microsoft.build.construction.projectrootelement) instance loaded from the file system. Returns null if no project has been loaded or if loading failed. ### ProjectErrors Gets the collection of project loading and processing errors. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ProjectErrors { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` A list of [CompilerError](https://learn.microsoft.com/dotnet/api/system.codedom.compiler.compilererror) instances representing any errors encountered during project loading, validation, or processing operations. ## Methods ### AddItemGroup Adds an ItemGroup with the specified condition and configures it using the provided action. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.MSBuildProjectManager AddItemGroup(string condition, System.Action configure) ``` #### Parameters | Name | Type | Description | | - | - | - | | `condition` | `string` | The condition for the ItemGroup. | | `configure` | `System.Action` | An action to configure the ItemGroup. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.MSBuildProjectManager` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when configure is null. | | `InvalidOperationException` | Thrown when no project is loaded. | ### AddPackageReference Adds a PackageReference to the project. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.MSBuildProjectManager AddPackageReference(string packageId, string version, string condition = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `packageId` | `string` | The package ID. | | `version` | `string` | The package version. | | `condition` | `string` | Optional condition for the PackageReference. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.MSBuildProjectManager` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when packageId or version is null or whitespace. | | `InvalidOperationException` | Thrown when no project is loaded. | ### CreateNew Creates a new MSBuild project file with default structure. #### Syntax ```csharp theme={"dark"} public void CreateNew(string filePath, string targetFramework = "net8.0") ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path where the new project should be created. | | `targetFramework` | `string` | The target framework for the project (default: net8.0). | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when filePath is null or whitespace. | ### EnsureMSBuildRegistered Ensures MSBuild is registered with the latest available version. #### Syntax ```csharp theme={"dark"} public static void EnsureMSBuildRegistered() ``` #### Remarks This method should be called before any MSBuild operations to ensure the correct version of MSBuild is loaded. On .NET Core, QueryVisualStudioInstances() returns SDK instances (versions like 8.0.x, 9.0.x, 10.0.x), not Visual Studio instances. We explicitly select and register the latest available instance. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetPropertyValue Gets the value of a property from the project. #### Syntax ```csharp theme={"dark"} public string GetPropertyValue(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The property name. | #### Returns Type: `string` The property value, or null if the property does not exist. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when name is null or whitespace. | | `InvalidOperationException` | Thrown when no project is loaded. | ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Load Loads an existing MSBuild project file from the file path specified in the constructor. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.MSBuildProjectManager Load(bool preserveFormatting = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `preserveFormatting` | `bool` | Whether to preserve the original formatting of the project file. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.MSBuildProjectManager` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown when no file path has been specified. | ### Load Loads an existing MSBuild project file from the specified file path. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.MSBuildProjectManager Load(string filePath, bool preserveFormatting = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to the MSBuild project file. | | `preserveFormatting` | `bool` | Whether to preserve the original formatting of the project file. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.MSBuildProjectManager` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when filePath is null or whitespace. | ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveProperty Removes a property from the project. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.MSBuildProjectManager RemoveProperty(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The property name to remove. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.MSBuildProjectManager` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when name is null or whitespace. | | `InvalidOperationException` | Thrown when no project is loaded. | ### Save Saves the current project to the file system using the original file path. #### Syntax ```csharp theme={"dark"} public void Save() ``` #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown when no project is loaded or no file path is specified. | ### Save Saves the current project to the specified file path. #### Syntax ```csharp theme={"dark"} public void Save(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path where the project should be saved. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when filePath is null or whitespace. | | `InvalidOperationException` | Thrown when no project is loaded. | ### SetProperty Sets a property value in the project. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.MSBuild.MSBuildProjectManager SetProperty(string name, string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The property name. | | `value` | `string` | The property value. | #### Returns Type: `CloudNimble.EasyAF.MSBuild.MSBuildProjectManager` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when name or value is null or whitespace. | | `InvalidOperationException` | Thrown when no project is loaded. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/MSBuild/index Summary of the CloudNimble.EasyAF.MSBuild Namespace ## Types ### Classes | Name | Summary | | - | - | | [ItemBuilder](/api-reference/CloudNimble/EasyAF/MSBuild/ItemBuilder) | Builder class for configuring individual MSBuild items in a fluent manner. | | [ItemGroupBuilder](/api-reference/CloudNimble/EasyAF/MSBuild/ItemGroupBuilder) | Builder class for configuring MSBuild ItemGroups in a fluent manner. | | [MSBuildProjectManager](/api-reference/CloudNimble/EasyAF/MSBuild/MSBuildProjectManager) | Manages MSBuild project files (.csproj, Directory.Build.props, etc.) with formatting preservation capabilities. | # SystemTextJsonContractResolver Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/NewtonsoftJson/Compatibility/SystemTextJsonContractResolver Provides support for [JsonIgnoreAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonignoreattribute), [JsonExtensionDataAttr... ## Definition **Assembly:** CloudNimble.EasyAF.NewtonsoftJson.Compatibility.dll **Namespace:** CloudNimble.EasyAF.NewtonsoftJson.Compatibility **Inheritance:** Newtonsoft.Json.Serialization.DefaultContractResolver ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.NewtonsoftJson.Compatibility.SystemTextJsonContractResolver ``` ## Summary Provides support for [JsonIgnoreAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonignoreattribute), [JsonExtensionDataAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonextensiondataattribute), and [JsonPropertyNameAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonpropertynameattribute) in System.Text.Json scenarios. ## Remarks Influenced by [https://github.com/RicoSuter/NJsonSchema/blob/master/src/NJsonSchema/Generation/SystemTextJsonUtilities.cs](https://github.com/RicoSuter/NJsonSchema/blob/master/src/NJsonSchema/Generation/SystemTextJsonUtilities.cs) ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SystemTextJsonContractResolver() ``` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/NewtonsoftJson/Compatibility/index Summary of the CloudNimble.EasyAF.NewtonsoftJson.Compatibility Namespace ## Types ### Classes | Name | Summary | | - | - | | [SystemTextJsonContractResolver](/api-reference/CloudNimble/EasyAF/NewtonsoftJson/Compatibility/SystemTextJsonContractResolver) | Provides support for [JsonIgnoreAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonignoreattribute), [JsonExtensionDataAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonextensiondataattribute), and [JsonPropertyNameAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonpropertynameattribute) in System.Text.Json scenarios. | # ApiBatch Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/OData/ApiBatch Provides a pre-configured Simple.OData.V4 `ODataBatch` Client. ## Definition **Assembly:** CloudNimble.EasyAF.ODataClient.dll **Namespace:** CloudNimble.EasyAF.OData **Inheritance:** Simple.OData.Client.ODataBatch ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.OData.ApiBatch ``` ## Summary Provides a pre-configured Simple.OData.V4 `ODataBatch` Client. ## Constructors ### .ctor Initializes a new instance of the Simple.OData.Client.ODataClient class with custom configuration #### Syntax ```csharp theme={"dark"} public ApiBatch(System.Net.Http.IHttpClientFactory httpClientFactory, CloudNimble.EasyAF.Configuration.ConfigurationBase configurationBase, string apiClientName = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | An [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) instance, provided by DI. | | `configurationBase` | `CloudNimble.EasyAF.Configuration.ConfigurationBase` | A [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase) instance, containing the name identifier for the [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient). | | `apiClientName` | `string` | Optional name for the API client. If not provided, uses the ApiClientName from the configuration. | ## Methods ### Add Overloads the Add operator used to add `IODataClient` operations to the `ODataBatch`. Provides an alternative method-based syntax for adding operations to the batch. #### Syntax ```csharp theme={"dark"} public static CloudNimble.EasyAF.OData.ApiBatch Add(CloudNimble.EasyAF.OData.ApiBatch batch, System.Func action) ``` #### Parameters | Name | Type | Description | | - | - | - | | `batch` | `CloudNimble.EasyAF.OData.ApiBatch` | The ApiBatch instance to add the operation to. | | `action` | `System.Func` | The async operation to add to the batch. | #### Returns Type: `CloudNimble.EasyAF.OData.ApiBatch` The ApiBatch instance for method chaining. # ApiClient Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/OData/ApiClient Provides a pre-configured Simple.OData.V4 `ODataClient`. ## Definition **Assembly:** CloudNimble.EasyAF.ODataClient.dll **Namespace:** CloudNimble.EasyAF.OData **Inheritance:** Simple.OData.Client.ODataClient ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.OData.ApiClient ``` ## Summary Provides a pre-configured Simple.OData.V4 `ODataClient`. ## Constructors ### .ctor Initializes a new instance of the Simple.OData.Client.ODataClient class with custom configuration #### Syntax ```csharp theme={"dark"} public ApiClient(System.Net.Http.IHttpClientFactory httpClientFactory, CloudNimble.EasyAF.Configuration.ConfigurationBase configurationBase, string apiClientName = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | An [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) instance, provided by DI. | | `configurationBase` | `CloudNimble.EasyAF.Configuration.ConfigurationBase` | A [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase) instance, containing the name identifier for the [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient). | | `apiClientName` | `string` | Optional name for the API client. If not provided, uses the ApiClientName from the configuration. | # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/OData/index Summary of the CloudNimble.EasyAF.OData Namespace ## Types ### Classes | Name | Summary | | - | - | | [ApiBatch](/api-reference/CloudNimble/EasyAF/OData/ApiBatch) | Provides a pre-configured Simple.OData.V4 `ODataBatch` Client. | | [ApiClient](/api-reference/CloudNimble/EasyAF/OData/ApiClient) | Provides a pre-configured Simple.OData.V4 `ODataClient`. | # EasyAFEntityFrameworkApi Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Restier/EasyAFEntityFrameworkApi Provides a base implementation of an Entity Framework API for EasyAF, integrating SimpleMessageBus event publishing and logging capabilities. This class ex... ## Definition **Assembly:** CloudNimble.EasyAF.Restier.EF6.dll **Namespace:** CloudNimble.EasyAF.Restier **Inheritance:** Microsoft.Restier.EntityFramework.EntityFrameworkApi\ ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Restier.EasyAFEntityFrameworkApi ``` ## Summary Provides a base implementation of an Entity Framework API for EasyAF, integrating SimpleMessageBus event publishing and logging capabilities. This class extends [EntityFrameworkApi\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.entityframework.entityframeworkapi-1) and is intended to be used as a base class for APIs that require access to the current HTTP context, logging, and SimpleMessageBus publishing. ## Type Parameters * `TContext` - The type of the [DbContext](https://learn.microsoft.com/dotnet/api/system.data.entity.dbcontext) used by the API. ## Examples ```csharp theme={"dark"} public class MyApi : EasyAFEntityFrameworkApi<MyDbContext> { public MyApi(IServiceProvider serviceProvider, IHttpContextAccessor httpContextAccessor, IMessagePublisher messagePublisher, ILogger<EasyAFEntityFrameworkApi<MyDbContext>> logger) : base(serviceProvider, httpContextAccessor, messagePublisher, logger) { } } ``` ## Constructors ### .ctor Initializes a new instance of the `EasyAFEntityFrameworkApi`1\` class. #### Syntax ```csharp theme={"dark"} public EasyAFEntityFrameworkApi(System.IServiceProvider serviceProvider, Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor, CloudNimble.SimpleMessageBus.Publish.IMessagePublisher messagePublisher, Microsoft.Extensions.Logging.ILogger> logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceProvider` | `System.IServiceProvider` | The service provider for dependency injection. | | `httpContextAccessor` | `Microsoft.AspNetCore.Http.IHttpContextAccessor` | The [IHttpContextAccessor](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.ihttpcontextaccessor) for the current HTTP context. | | `messagePublisher` | `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` | The `IMessagePublisher` used for publishing messages to SimpleMessageBus. | | `logger` | `Microsoft.Extensions.Logging.ILogger>` | The [ILogger\`1](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1) instance for writing log traces. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown if *httpContextAccessor* or *messagePublisher* is `null`. | ## Properties ### HttpContextAccessor Gets or sets the accessor for the current HTTP context. Used to access HTTP-specific information about the current request. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Http.IHttpContextAccessor` ### Logger Gets or sets the [ILogger\`1](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1) instance used for writing log traces. #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.Logging.ILogger> Logger { get; set; } ``` #### Property Value Type: `Microsoft.Extensions.Logging.ILogger>` ### MessagePublisher Gets or sets the `IMessagePublisher` used for publishing messages to SimpleMessageBus. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Publish.IMessagePublisher MessagePublisher { get; set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Publish.IMessagePublisher` # RestierHelpers Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Restier/RestierHelpers Provides utility methods for logging Restier operations and entity lifecycle events. Supports logging for both named entities and identifiable entities with ... ## Definition **Assembly:** CloudNimble.EasyAF.Restier.dll **Namespace:** CloudNimble.EasyAF.Restier **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Restier.RestierHelpers ``` ## Summary Provides utility methods for logging Restier operations and entity lifecycle events. Supports logging for both named entities and identifiable entities with detailed operation tracking. ## Methods ### LogOperation Logs a Restier operation for the specified entity type name. Formats the log message with appropriate verb tense based on operation type. #### Syntax ```csharp theme={"dark"} public static void LogOperation(string entityName, CloudNimble.EasyAF.Restier.RestierOperationType operation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityName` | `string` | The name of the entity type being operated on. | | `operation` | `CloudNimble.EasyAF.Restier.RestierOperationType` | The type of operation being performed. | ### LogOperation Logs a Restier operation for the specified DbObservableObject entity. Extracts the entity type name and delegates to the string-based logging method. #### Syntax ```csharp theme={"dark"} public static void LogOperation(CloudNimble.EasyAF.Core.DbObservableObject entity, CloudNimble.EasyAF.Restier.RestierOperationType operation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `CloudNimble.EasyAF.Core.DbObservableObject` | The entity being operated on. | | `operation` | `CloudNimble.EasyAF.Restier.RestierOperationType` | The type of operation being performed. | ### LogOperation Logs a Restier operation for the specified identifiable entity, including the entity's ID in the log message. Provides more detailed logging by including the specific entity identifier. #### Syntax ```csharp theme={"dark"} public static void LogOperation(T entity, CloudNimble.EasyAF.Restier.RestierOperationType operation) where T : CloudNimble.EasyAF.Core.IIdentifiable where TId : struct, System.ValueType ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `T` | The identifiable entity being operated on. | | `operation` | `CloudNimble.EasyAF.Restier.RestierOperationType` | The type of operation being performed. | #### Type Parameters * `T` - The type of entity that implements IIdentifiable. * `TId` - The type of the entity's identifier. # RestierOperationType Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Restier/RestierOperationType Specifies the type of operation being performed in Restier for logging and tracking purposes. Used by RestierHelpers to provide consistent operation logging ... ## Definition **Assembly:** CloudNimble.EasyAF.Restier.dll **Namespace:** CloudNimble.EasyAF.Restier **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Restier.RestierOperationType ``` ## Summary Specifies the type of operation being performed in Restier for logging and tracking purposes. Used by RestierHelpers to provide consistent operation logging across entity lifecycle events. ## Values | Name | Value | Description | | - | - | - | | `Filtered` | 1 | Indicates that entities have been filtered during query operations. | | `Inserting` | 2 | Indicates that an entity is currently being inserted (in progress). | | `Inserted` | 3 | Indicates that an entity has been successfully inserted (completed). | | `Updating` | 4 | Indicates that an entity is currently being updated (in progress). | | `Updated` | 5 | Indicates that an entity has been successfully updated (completed). | | `Deleting` | 6 | Indicates that an entity is currently being deleted (in progress). | | `Deleted` | 7 | Indicates that an entity has been successfully deleted (completed). | # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Restier/index Summary of the CloudNimble.EasyAF.Restier Namespace ## Types ### Classes | Name | Summary | | - | - | | [RestierOperationType](/api-reference/CloudNimble/EasyAF/Restier/RestierOperationType) | Specifies the type of operation being performed in Restier for logging and tracking purposes. Used by RestierHelpers to provide consistent operation logging across entity lifecycle events. | | [RestierHelpers](/api-reference/CloudNimble/EasyAF/Restier/RestierHelpers) | Provides utility methods for logging Restier operations and entity lifecycle events. Supports logging for both named entities and identifiable entities with detailed operation tracking. | | [EasyAFEntityFrameworkApi](/api-reference/CloudNimble/EasyAF/Restier/EasyAFEntityFrameworkApi) | Provides a base implementation of an Entity Framework API for EasyAF, integrating SimpleMessageBus event publishing and logging capabilities. This class extends [EntityFrameworkApi\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.entityframework.entityframeworkapi-1) and is intended to be used as a base class for APIs that require access to the current HTTP context, logging, and SimpleMessageBus publishing. | ### Enums | Name | Summary | | - | - | | [RestierOperationType](/api-reference/CloudNimble/EasyAF/Restier/RestierOperationType) | Specifies the type of operation being performed in Restier for logging and tracking purposes. Used by RestierHelpers to provide consistent operation logging across entity lifecycle events. | # CleanupCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/CleanupCommand Command for cleaning up build artifacts and lock files from the solution. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.CleanupCommand ``` ## Summary Command for cleaning up build artifacts and lock files from the solution. ## Remarks This command recursively deletes bin, obj, TestResults directories and packages.lock.json files from the current directory and all subdirectories. ## Examples ```csharp theme={"dark"} dotnet easyaf cleanup dotnet easyaf cleanup --dry-run dotnet easyaf cleanup --path "C:\Projects\MyApp" ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public CleanupCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DryRun Gets or sets a value indicating whether to show what would be deleted without actually deleting. #### Syntax ```csharp theme={"dark"} public bool DryRun { get; set; } ``` #### Property Value Type: `bool` ### Path Gets or sets the root directory to clean. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string Path { get; set; } ``` #### Property Value Type: `string` ### Quiet Gets or sets a value indicating whether to run in quiet mode with minimal output. #### Syntax ```csharp theme={"dark"} public bool Quiet { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the cleanup command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code (0 for success, 1 for error). ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # CodeGenerateCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/CodeGenerateCommand Represents a command for generating code for a specified EasyAF component. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.CodeGenerateCommand ``` ## Summary Represents a command for generating code for a specified EasyAF component. ## Remarks This command is used within the EasyAF tooling to automate the generation of code for various components, such as business logic, core libraries, data access, APIs, or all components at once. ## Examples ```csharp theme={"dark"} dotnet easyaf generate business -path "C:\Projects\MyApp" -dontdelete "Controllers\Public" -notpublic "User,Role" ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public CodeGenerateCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Component Gets or sets the component to generate. Available options: business, core, data, api, simplemessagebus, all. #### Syntax ```csharp theme={"dark"} public string Component { get; set; } ``` #### Property Value Type: `string` ### DontDelete Gets or sets a directory that will be ignored when deleting files during code generation. #### Syntax ```csharp theme={"dark"} public string DontDelete { get; set; } ``` #### Property Value Type: `string` ### NotPublic Gets or sets a comma-separated list of table names to ignore when generating the public API surface. #### Syntax ```csharp theme={"dark"} public string NotPublic { get; set; } ``` #### Property Value Type: `string` ### Root Gets or sets the working directory for the code compiler. Defaults to the current directory if not specified. #### Syntax ```csharp theme={"dark"} public string Root { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the code generation command asynchronously. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A [Task\`1](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) representing the asynchronous operation, with a result of 0 on success. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DatabaseGenerateCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseGenerateCommand Command for generating EDMX from database. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.DatabaseGenerateCommand ``` ## Summary Command for generating EDMX from database. ## Constructors ### .ctor Initializes a new instance of the [DatabaseGenerateCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseGenerateCommand) class. #### Syntax ```csharp theme={"dark"} public DatabaseGenerateCommand(CloudNimble.EasyAF.EFCoreToEdmx.EdmxConverter converter) ``` #### Parameters | Name | Type | Description | | - | - | - | | `converter` | `CloudNimble.EasyAF.EFCoreToEdmx.EdmxConverter` | The EDMX converter service. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ContextName Gets or sets the DbContext class name to use for finding the configuration file. When not specified, all .edmx.config files will be processed. #### Syntax ```csharp theme={"dark"} public string ContextName { get; set; } ``` #### Property Value Type: `string` ### Project Gets or sets the project directory path (defaults to auto-detected .Data folder). #### Syntax ```csharp theme={"dark"} public string Project { get; set; } ``` #### Property Value Type: `string` ### SolutionFolder Gets or sets the working directory for the solution. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string SolutionFolder { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the generate command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DatabaseInitCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseInitCommand Command for initializing database scaffolding configuration. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.DatabaseInitCommand ``` ## Summary Command for initializing database scaffolding configuration. ## Constructors ### .ctor Initializes a new instance of the [DatabaseInitCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseInitCommand) class. #### Syntax ```csharp theme={"dark"} public DatabaseInitCommand(CloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManager configManager) ``` #### Parameters | Name | Type | Description | | - | - | - | | `configManager` | `CloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManager` | The configuration manager service. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ConnectionString Gets or sets the connection string source. #### Syntax ```csharp theme={"dark"} public string ConnectionString { get; set; } ``` #### Property Value Type: `string` ### ContextName Gets or sets the DbContext class name. #### Syntax ```csharp theme={"dark"} public string ContextName { get; set; } ``` #### Property Value Type: `string` ### DbContextNamespace Gets or sets the namespace for the generated DbContext. #### Syntax ```csharp theme={"dark"} public string DbContextNamespace { get; set; } ``` #### Property Value Type: `string` ### ExcludeTables Gets or sets the tables to exclude. #### Syntax ```csharp theme={"dark"} public string[] ExcludeTables { get; set; } ``` #### Property Value Type: `string[]` ### NoDataAnnotations Gets or sets a value indicating whether to disable data annotations. #### Syntax ```csharp theme={"dark"} public bool NoDataAnnotations { get; set; } ``` #### Property Value Type: `bool` ### NoPluralize Gets or sets a value indicating whether to disable pluralization. #### Syntax ```csharp theme={"dark"} public bool NoPluralize { get; set; } ``` #### Property Value Type: `bool` ### ObjectsNamespace Gets or sets the namespace for the generated entity objects. #### Syntax ```csharp theme={"dark"} public string ObjectsNamespace { get; set; } ``` #### Property Value Type: `string` ### Provider Gets or sets the database provider. #### Syntax ```csharp theme={"dark"} public string Provider { get; set; } ``` #### Property Value Type: `string` ### SolutionFolder Gets or sets the working directory for the solution. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string SolutionFolder { get; set; } ``` #### Property Value Type: `string` ### Tables Gets or sets the specific tables to include. #### Syntax ```csharp theme={"dark"} public string[] Tables { get; set; } ``` #### Property Value Type: `string[]` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the init command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DatabaseRefreshCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseRefreshCommand Command for refreshing existing EDMX files. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.DatabaseRefreshCommand ``` ## Summary Command for refreshing existing EDMX files. ## Constructors ### .ctor Initializes a new instance of the [DatabaseRefreshCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseRefreshCommand) class. #### Syntax ```csharp theme={"dark"} public DatabaseRefreshCommand(CloudNimble.EasyAF.EFCoreToEdmx.EdmxConverter converter) ``` #### Parameters | Name | Type | Description | | - | - | - | | `converter` | `CloudNimble.EasyAF.EFCoreToEdmx.EdmxConverter` | The EDMX converter service. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ContextName Gets or sets the DbContext class name to use for finding the EDMX and configuration files. When not specified, all .edmx files will be processed. #### Syntax ```csharp theme={"dark"} public string ContextName { get; set; } ``` #### Property Value Type: `string` ### Project Gets or sets the project directory path (defaults to auto-detected .Data folder). #### Syntax ```csharp theme={"dark"} public string Project { get; set; } ``` #### Property Value Type: `string` ### SolutionFolder Gets or sets the working directory for the solution. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string SolutionFolder { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the refresh command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EasyAFBaseCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/EasyAFBaseCommand Base class for EasyAF commands that provides common functionality for MSBuild operations, user secrets management, and project configuration. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand ``` ## Summary Base class for EasyAF commands that provides common functionality for MSBuild operations, user secrets management, and project configuration. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmxGenerateCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxGenerateCommand Command to generate an EDMX file from an EF Core DbContext in the Data project. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.EdmxGenerateCommand ``` ## Summary Command to generate an EDMX file from an EF Core DbContext in the Data project. ## Remarks This command locates the Data project, finds the compiled assembly, and generates an EDMX file using the `EdmxConverter`. The output file is placed in the Data project directory. ## Examples ```csharp theme={"dark"} dotnet easyaf edmx generate --path "C:\MySolution" ``` ## Constructors ### .ctor Initializes a new instance of the [EdmxGenerateCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxGenerateCommand) class. #### Syntax ```csharp theme={"dark"} public EdmxGenerateCommand(CloudNimble.EasyAF.EFCoreToEdmx.EdmxConverter converter) ``` #### Parameters | Name | Type | Description | | - | - | - | | `converter` | `CloudNimble.EasyAF.EFCoreToEdmx.EdmxConverter` | The EDMX converter service. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Context Gets or sets the DbContext class to use. #### Syntax ```csharp theme={"dark"} public string Context { get; set; } ``` #### Property Value Type: `string` ### Environment Gets or sets the environment to use (Development, Production, etc). #### Syntax ```csharp theme={"dark"} public string Environment { get; set; } ``` #### Property Value Type: `string` ### Project Gets or sets the project folder containing the DbContext. #### Syntax ```csharp theme={"dark"} public string Project { get; set; } ``` #### Property Value Type: `string` ### Root Gets or sets the working directory for the code compiler. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string Root { get; set; } ``` #### Property Value Type: `string` ### StartupProject Gets or sets the startup project folder. #### Syntax ```csharp theme={"dark"} public string StartupProject { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the EDMX generation command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` 0 if successful, 1 if an error occurred. #### Examples ```csharp theme={"dark"} dotnet easyaf edmx generate --path "C:\MySolution" ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmxRootCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxRootCommand Root command for EDMX file utilities. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.EdmxRootCommand ``` ## Summary Root command for EDMX file utilities. ## Remarks This command serves as the entry point for all EDMX-related subcommands, such as generate, swap, and watch. It provides shared utility methods for locating project folders and EDMX files. ## Examples ```csharp theme={"dark"} dotnet easyaf edmx --help ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EdmxRootCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FindDataFolder Attempts to find the .Data folder in the given root directory. #### Syntax ```csharp theme={"dark"} public static string FindDataFolder(string rootFolder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `rootFolder` | `string` | The root directory to search. | #### Returns Type: `string` The path to the .Data folder, or `null` if not found. #### Examples ```csharp theme={"dark"} var dataFolder = EdmxRootCommand.FindDataFolder("C:\\MySolution"); ``` ### FindEdmxFile Attempts to find the first EDMX file in the given folder. #### Syntax ```csharp theme={"dark"} public static string FindEdmxFile(string folder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `folder` | `string` | The folder to search for EDMX files. | #### Returns Type: `string` The path to the first EDMX file found, or `null` if none found. #### Examples ```csharp theme={"dark"} var edmxFile = EdmxRootCommand.FindEdmxFile("C:\\MySolution\\MyProject.Data"); ``` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecute Shows help for the edmx command. #### Syntax ```csharp theme={"dark"} public int OnExecute(McMaster.Extensions.CommandLineUtils.CommandLineApplication app) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `McMaster.Extensions.CommandLineUtils.CommandLineApplication` | The command line application. | #### Returns Type: `int` Exit code 1. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmxSwapCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxSwapCommand Command to switch the Provider in the EDMX file between System.Data.SqlClient and Microsoft.Data.SqlClient. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.EdmxSwapCommand ``` ## Summary Command to switch the Provider in the EDMX file between System.Data.SqlClient and Microsoft.Data.SqlClient. ## Remarks This command locates the EDMX file in the specified directory (or the .Data folder) and swaps the provider string. ## Examples ```csharp theme={"dark"} dotnet easyaf edmx swap --path "C:\MySolution" ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EdmxSwapCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Root Gets or sets the working directory for the code compiler. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string Root { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the EDMX provider swap command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` 0 if successful, 1 if an error occurred. #### Examples ```csharp theme={"dark"} dotnet easyaf edmx swap --path "C:\MySolution" ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmxWatchCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxWatchCommand Command to watch EDMX files in your Data project for changes and regenerate the framework. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.EdmxWatchCommand ``` ## Summary Command to watch EDMX files in your Data project for changes and regenerate the framework. ## Remarks This command monitors the Data project for changes to EDMX files and triggers regeneration logic when changes are detected. It is useful for development workflows where EDMX files are updated frequently. ## Examples ```csharp theme={"dark"} dotnet easyaf edmx watch --path "C:\MySolution" ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EdmxWatchCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Root Gets or sets the working directory for the code compiler. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string Root { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the EDMX watch command, monitoring for file changes. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` 0 when completed. #### Examples ```csharp theme={"dark"} dotnet easyaf edmx watch --path "C:\MySolution" ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # InitCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/InitCommand Command for initializing EasyAF project configuration including database scaffolding, project types, and analyzer setup. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.InitCommand ``` ## Summary Command for initializing EasyAF project configuration including database scaffolding, project types, and analyzer setup. ## Constructors ### .ctor Initializes a new instance of the [InitCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/InitCommand) class. #### Syntax ```csharp theme={"dark"} public InitCommand(CloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManager configManager) ``` #### Parameters | Name | Type | Description | | - | - | - | | `configManager` | `CloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManager` | The configuration manager service. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` #### Syntax ```csharp theme={"dark"} protected EasyAFBaseCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ConnectionString Gets or sets the connection string source. #### Syntax ```csharp theme={"dark"} public string ConnectionString { get; set; } ``` #### Property Value Type: `string` ### ContextName Gets or sets the DbContext class name. #### Syntax ```csharp theme={"dark"} public string ContextName { get; set; } ``` #### Property Value Type: `string` ### DbContextNamespace Gets or sets the namespace for the generated DbContext. #### Syntax ```csharp theme={"dark"} public string DbContextNamespace { get; set; } ``` #### Property Value Type: `string` ### ExcludeTables Gets or sets the tables to exclude. #### Syntax ```csharp theme={"dark"} public string[] ExcludeTables { get; set; } ``` #### Property Value Type: `string[]` ### NoDataAnnotations Gets or sets a value indicating whether to disable data annotations. #### Syntax ```csharp theme={"dark"} public bool NoDataAnnotations { get; set; } ``` #### Property Value Type: `bool` ### NoPluralize Gets or sets a value indicating whether to disable pluralization. #### Syntax ```csharp theme={"dark"} public bool NoPluralize { get; set; } ``` #### Property Value Type: `bool` ### ObjectsNamespace Gets or sets the namespace for the generated entity objects. #### Syntax ```csharp theme={"dark"} public string ObjectsNamespace { get; set; } ``` #### Property Value Type: `string` ### Provider Gets or sets the database provider. #### Syntax ```csharp theme={"dark"} public string Provider { get; set; } ``` #### Property Value Type: `string` ### SimpleMessageBusProject Gets or sets the SimpleMessageBus project name to create. If specified, creates a new SimpleMessageBus project. #### Syntax ```csharp theme={"dark"} public string SimpleMessageBusProject { get; set; } ``` #### Property Value Type: `string` ### SolutionFolder Gets or sets the working directory for the solution. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string SolutionFolder { get; set; } ``` #### Property Value Type: `string` ### Tables Gets or sets the specific tables to include. #### Syntax ```csharp theme={"dark"} public string[] Tables { get; set; } ``` #### Property Value Type: `string[]` ## Methods ### CheckMSBuildRegistered Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Ensures MSBuild is registered with the latest available version. #### Syntax ```csharp theme={"dark"} protected static void CheckMSBuildRegistered() ``` ### ConfigureDirectoryBuildProps Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Configures Directory.Build.props with EasyAF namespace, UserSecretsId, and analyzer references using MSBuildProjectManager. #### Syntax ```csharp theme={"dark"} protected static void ConfigureDirectoryBuildProps(string commonNamespace, string userSecretsId, string[] projectFiles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `commonNamespace` | `string` | The common namespace to set. | | `userSecretsId` | `string` | The UserSecretsId to set. | | `projectFiles` | `string[]` | Array of project file paths. | ### ConfigureProjectTypes Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Discovers and configures project types and namespace for all projects in the current directory and subdirectories. #### Syntax ```csharp theme={"dark"} protected static void ConfigureProjectTypes(string userSecretsId) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userSecretsId` | `string` | The UserSecretsId to set in Directory.Build.props. | ### DetectCommonNamespace Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Detects the common namespace from existing projects. #### Syntax ```csharp theme={"dark"} protected static string DetectCommonNamespace(string[] projectFiles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFiles` | `string[]` | Array of project file paths. | #### Returns Type: `string` The detected common namespace, or null if none found. ### DetermineProjectType Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Determines the EasyAFProjectType based on the project file name and content. #### Syntax ```csharp theme={"dark"} protected static string DetermineProjectType(string projectFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | #### Returns Type: `string` The determined project type, or null if no supported type is detected. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExtractUserSecretsId Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from a project file using MSBuild evaluation. This will properly evaluate the project with all imports including Directory.Build.props. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsId(string projectFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### ExtractUserSecretsIdFromDataProject Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from the data project folder. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsIdFromDataProject(string dataFolder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataFolder` | `string` | The data project folder path. | #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### ExtractUserSecretsIdFromDirectoryBuildProps Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from Directory.Build.props in the current directory. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsIdFromDirectoryBuildProps() ``` #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### FindCommonPrefix Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Finds the common prefix among a list of strings. #### Syntax ```csharp theme={"dark"} protected static string FindCommonPrefix(System.Collections.Generic.List strings) ``` #### Parameters | Name | Type | Description | | - | - | - | | `strings` | `System.Collections.Generic.List` | The list of strings to find common prefix for. | #### Returns Type: `string` The common prefix. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the init command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetProjectType Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Adds or updates the EasyAFProjectType property in a project file using MSBuildProjectManager. #### Syntax ```csharp theme={"dark"} protected static void SetProjectType(string projectFilePath, string projectType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | | `projectType` | `string` | The project type to set. | ### SetUserSecretAsync Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Sets a user secret value using the official dotnet user-secrets CLI tool. #### Syntax ```csharp theme={"dark"} protected static System.Threading.Tasks.Task SetUserSecretAsync(string userSecretsId, string key, string value, string projectPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userSecretsId` | `string` | The user secrets ID. | | `key` | `string` | The secret key. | | `value` | `string` | The secret value. | | `projectPath` | `string` | The project directory path. | #### Returns Type: `System.Threading.Tasks.Task` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NewCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/NewCommand Creates a new EasyAF solution: the Core, Data, Business, Api, MessageBus, and Tests projects, referenced the way EasyAF expects, with the solution-level buil... ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.NewCommand ``` ## Summary Creates a new EasyAF solution: the Core, Data, Business, Api, MessageBus, and Tests projects, referenced the way EasyAF expects, with the solution-level build files and an `.slnx`. ## Remarks Projects are created in-process from the SDK's own `classlib`, `web`, and `console` templates, then configured with EasyAF project types, package references, and project references. EasyAF files (Program.cs, appsettings, test bases) are written over the template output. `new` only creates and links projects. It doesn't connect a database, restore, build, or start any process; `dotnet easyaf init` connects a database afterwards. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NewCommand() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` #### Syntax ```csharp theme={"dark"} protected EasyAFBaseCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Framework Gets or sets the target framework: `net10.0` (the default) or `net11.0`. #### Syntax ```csharp theme={"dark"} public string Framework { get; set; } ``` #### Property Value Type: `string` ### Name Gets or sets the solution name. It is also the root namespace unless [NewCommand.Namespace](/api-reference/CloudNimble/EasyAF/Tools/Commands/NewCommand#namespace) is set. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### Namespace Gets or sets the root namespace for the projects. Defaults to [NewCommand.Name](/api-reference/CloudNimble/EasyAF/Tools/Commands/NewCommand#name). #### Syntax ```csharp theme={"dark"} public string Namespace { get; set; } ``` #### Property Value Type: `string` ### NoApi Gets or sets whether to leave out the Api project and its tests. #### Syntax ```csharp theme={"dark"} public bool NoApi { get; set; } ``` #### Property Value Type: `bool` ### NoMessageBus Gets or sets whether to leave out the MessageBus.Core, MessageBus.Dispatch, and MessageBus.Runtime projects. #### Syntax ```csharp theme={"dark"} public bool NoMessageBus { get; set; } ``` #### Property Value Type: `bool` ### NoRuntime Gets or sets whether to leave out only the MessageBus.Runtime project. #### Syntax ```csharp theme={"dark"} public bool NoRuntime { get; set; } ``` #### Property Value Type: `bool` ### OutputDirectory Gets or sets the folder to create the solution in. Defaults to `./{Name}`. #### Syntax ```csharp theme={"dark"} public string OutputDirectory { get; set; } ``` #### Property Value Type: `string` ### WebJob Gets or sets whether to add Azure WebJob publish settings to the MessageBus.Runtime project. #### Syntax ```csharp theme={"dark"} public bool WebJob { get; set; } ``` #### Property Value Type: `bool` ## Methods ### CheckMSBuildRegistered Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Ensures MSBuild is registered with the latest available version. #### Syntax ```csharp theme={"dark"} protected static void CheckMSBuildRegistered() ``` ### ConfigureDirectoryBuildProps Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Configures Directory.Build.props with EasyAF namespace, UserSecretsId, and analyzer references using MSBuildProjectManager. #### Syntax ```csharp theme={"dark"} protected static void ConfigureDirectoryBuildProps(string commonNamespace, string userSecretsId, string[] projectFiles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `commonNamespace` | `string` | The common namespace to set. | | `userSecretsId` | `string` | The UserSecretsId to set. | | `projectFiles` | `string[]` | Array of project file paths. | ### ConfigureProjectTypes Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Discovers and configures project types and namespace for all projects in the current directory and subdirectories. #### Syntax ```csharp theme={"dark"} protected static void ConfigureProjectTypes(string userSecretsId) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userSecretsId` | `string` | The UserSecretsId to set in Directory.Build.props. | ### DetectCommonNamespace Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Detects the common namespace from existing projects. #### Syntax ```csharp theme={"dark"} protected static string DetectCommonNamespace(string[] projectFiles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFiles` | `string[]` | Array of project file paths. | #### Returns Type: `string` The detected common namespace, or null if none found. ### DetermineProjectType Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Determines the EasyAFProjectType based on the project file name and content. #### Syntax ```csharp theme={"dark"} protected static string DetermineProjectType(string projectFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | #### Returns Type: `string` The determined project type, or null if no supported type is detected. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExtractUserSecretsId Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from a project file using MSBuild evaluation. This will properly evaluate the project with all imports including Directory.Build.props. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsId(string projectFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### ExtractUserSecretsIdFromDataProject Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from the data project folder. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsIdFromDataProject(string dataFolder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataFolder` | `string` | The data project folder path. | #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### ExtractUserSecretsIdFromDirectoryBuildProps Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from Directory.Build.props in the current directory. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsIdFromDirectoryBuildProps() ``` #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### FindCommonPrefix Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Finds the common prefix among a list of strings. #### Syntax ```csharp theme={"dark"} protected static string FindCommonPrefix(System.Collections.Generic.List strings) ``` #### Parameters | Name | Type | Description | | - | - | - | | `strings` | `System.Collections.Generic.List` | The list of strings to find common prefix for. | #### Returns Type: `string` The common prefix. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Creates the solution. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync(System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `cancellationToken` | `System.Threading.CancellationToken` | A token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` 0 when the solution was created; otherwise 1. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetProjectType Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Adds or updates the EasyAFProjectType property in a project file using MSBuildProjectManager. #### Syntax ```csharp theme={"dark"} protected static void SetProjectType(string projectFilePath, string projectType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | | `projectType` | `string` | The project type to set. | ### SetUserSecretAsync Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Sets a user secret value using the official dotnet user-secrets CLI tool. #### Syntax ```csharp theme={"dark"} protected static System.Threading.Tasks.Task SetUserSecretAsync(string userSecretsId, string key, string value, string projectPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userSecretsId` | `string` | The user secrets ID. | | `key` | `string` | The secret key. | | `value` | `string` | The secret value. | | `projectPath` | `string` | The project directory path. | #### Returns Type: `System.Threading.Tasks.Task` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # CodeRootCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/Root/CodeRootCommand Root command for code generation related subcommands. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands.Root **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.Root.CodeRootCommand ``` ## Summary Root command for code generation related subcommands. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public CodeRootCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecute Shows help for the code command. #### Syntax ```csharp theme={"dark"} public int OnExecute(McMaster.Extensions.CommandLineUtils.CommandLineApplication app) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `McMaster.Extensions.CommandLineUtils.CommandLineApplication` | The command line application. | #### Returns Type: `int` Exit code. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DatabaseRootCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/Root/DatabaseRootCommand Command-line interface for generating EDMX files from databases. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands.Root **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.Root.DatabaseRootCommand ``` ## Summary Command-line interface for generating EDMX files from databases. ## Remarks This class provides CLI commands for database scaffolding and EDMX generation, using McMaster.Extensions.CommandLineUtils for attribute-based command definition. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DatabaseRootCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecute Executes the database command. Shows help since this is a parent command. #### Syntax ```csharp theme={"dark"} public int OnExecute(McMaster.Extensions.CommandLineUtils.CommandLineApplication app) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `McMaster.Extensions.CommandLineUtils.CommandLineApplication` | The command line application. | #### Returns Type: `int` Exit code. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EasyAFRootCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/Root/EasyAFRootCommand Root command for the EasyAF command line tool. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands.Root **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.Root.EasyAFRootCommand ``` ## Summary Root command for the EasyAF command line tool. ## Remarks This class serves as the entry point for the EasyAF CLI tool and defines available subcommands. When executed without specific subcommands, it displays the help information. ## Examples ```csharp theme={"dark"} dotnet easyaf ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EasyAFRootCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecute Executes when the root command is invoked without subcommands. #### Syntax ```csharp theme={"dark"} public int OnExecute(McMaster.Extensions.CommandLineUtils.CommandLineApplication app) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `McMaster.Extensions.CommandLineUtils.CommandLineApplication` | The command line application instance. | #### Returns Type: `int` Exit code 1 to indicate no specific command was executed. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/Root/index Summary of the CloudNimble.EasyAF.Tools.Commands.Root Namespace ## Types ### Classes | Name | Summary | | - | - | | [CodeRootCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/Root/CodeRootCommand) | Root command for code generation related subcommands. | | [DatabaseRootCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/Root/DatabaseRootCommand) | Command-line interface for generating EDMX files from databases. | | [EasyAFRootCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/Root/EasyAFRootCommand) | Root command for the EasyAF command line tool. | # SetupCommand Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/SetupCommand Command for setting up local development environment for existing EasyAF projects. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Commands **Inheritance:** CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Commands.SetupCommand ``` ## Summary Command for setting up local development environment for existing EasyAF projects. ## Constructors ### .ctor Initializes a new instance of the [SetupCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/SetupCommand) class. #### Syntax ```csharp theme={"dark"} public SetupCommand(CloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManager configManager) ``` #### Parameters | Name | Type | Description | | - | - | - | | `configManager` | `CloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManager` | The configuration manager service. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` #### Syntax ```csharp theme={"dark"} protected EasyAFBaseCommand() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ConnectionString Gets or sets the connection string to store locally. #### Syntax ```csharp theme={"dark"} public string ConnectionString { get; set; } ``` #### Property Value Type: `string` ### ContextName Gets or sets the DbContext class name to configure. #### Syntax ```csharp theme={"dark"} public string ContextName { get; set; } ``` #### Property Value Type: `string` ### DryRun Gets or sets a value indicating whether to show what would be configured without making changes. #### Syntax ```csharp theme={"dark"} public bool DryRun { get; set; } ``` #### Property Value Type: `bool` ### SolutionFolder Gets or sets the working directory for the solution. Defaults to current directory. #### Syntax ```csharp theme={"dark"} public string SolutionFolder { get; set; } ``` #### Property Value Type: `string` ## Methods ### CheckMSBuildRegistered Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Ensures MSBuild is registered with the latest available version. #### Syntax ```csharp theme={"dark"} protected static void CheckMSBuildRegistered() ``` ### ConfigureDirectoryBuildProps Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Configures Directory.Build.props with EasyAF namespace, UserSecretsId, and analyzer references using MSBuildProjectManager. #### Syntax ```csharp theme={"dark"} protected static void ConfigureDirectoryBuildProps(string commonNamespace, string userSecretsId, string[] projectFiles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `commonNamespace` | `string` | The common namespace to set. | | `userSecretsId` | `string` | The UserSecretsId to set. | | `projectFiles` | `string[]` | Array of project file paths. | ### ConfigureProjectTypes Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Discovers and configures project types and namespace for all projects in the current directory and subdirectories. #### Syntax ```csharp theme={"dark"} protected static void ConfigureProjectTypes(string userSecretsId) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userSecretsId` | `string` | The UserSecretsId to set in Directory.Build.props. | ### DetectCommonNamespace Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Detects the common namespace from existing projects. #### Syntax ```csharp theme={"dark"} protected static string DetectCommonNamespace(string[] projectFiles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFiles` | `string[]` | Array of project file paths. | #### Returns Type: `string` The detected common namespace, or null if none found. ### DetermineProjectType Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Determines the EasyAFProjectType based on the project file name and content. #### Syntax ```csharp theme={"dark"} protected static string DetermineProjectType(string projectFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | #### Returns Type: `string` The determined project type, or null if no supported type is detected. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExtractUserSecretsId Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from a project file using MSBuild evaluation. This will properly evaluate the project with all imports including Directory.Build.props. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsId(string projectFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### ExtractUserSecretsIdFromDataProject Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from the data project folder. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsIdFromDataProject(string dataFolder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dataFolder` | `string` | The data project folder path. | #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### ExtractUserSecretsIdFromDirectoryBuildProps Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Extracts the UserSecretsId from Directory.Build.props in the current directory. #### Syntax ```csharp theme={"dark"} protected static string ExtractUserSecretsIdFromDirectoryBuildProps() ``` #### Returns Type: `string` The UserSecretsId if found, otherwise null. ### FindCommonPrefix Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Finds the common prefix among a list of strings. #### Syntax ```csharp theme={"dark"} protected static string FindCommonPrefix(System.Collections.Generic.List strings) ``` #### Parameters | Name | Type | Description | | - | - | - | | `strings` | `System.Collections.Generic.List` | The list of strings to find common prefix for. | #### Returns Type: `string` The common prefix. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the setup command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetProjectType Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Adds or updates the EasyAFProjectType property in a project file using MSBuildProjectManager. #### Syntax ```csharp theme={"dark"} protected static void SetProjectType(string projectFilePath, string projectType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectFilePath` | `string` | The path to the project file. | | `projectType` | `string` | The project type to set. | ### SetUserSecretAsync Inherited Inherited from `CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand` Sets a user secret value using the official dotnet user-secrets CLI tool. #### Syntax ```csharp theme={"dark"} protected static System.Threading.Tasks.Task SetUserSecretAsync(string userSecretsId, string key, string value, string projectPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userSecretsId` | `string` | The user secrets ID. | | `key` | `string` | The secret key. | | `value` | `string` | The secret value. | | `projectPath` | `string` | The project directory path. | #### Returns Type: `System.Threading.Tasks.Task` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Commands/index Summary of the CloudNimble.EasyAF.Tools.Commands Namespace ## Types ### Classes | Name | Summary | | - | - | | [CleanupCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/CleanupCommand) | Command for cleaning up build artifacts and lock files from the solution. | | [CodeGenerateCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/CodeGenerateCommand) | Represents a command for generating code for a specified EasyAF component. | | [DatabaseGenerateCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseGenerateCommand) | Command for generating EDMX from database. | | [DatabaseInitCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseInitCommand) | Command for initializing database scaffolding configuration. | | [DatabaseRefreshCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/DatabaseRefreshCommand) | Command for refreshing existing EDMX files. | | [EasyAFBaseCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/EasyAFBaseCommand) | Base class for EasyAF commands that provides common functionality for MSBuild operations, user secrets management, and project configuration. | | [EdmxGenerateCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxGenerateCommand) | Command to generate an EDMX file from an EF Core DbContext in the Data project. | | [EdmxSwapCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxSwapCommand) | Command to switch the Provider in the EDMX file between System.Data.SqlClient and Microsoft.Data.SqlClient. | | [EdmxWatchCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxWatchCommand) | Command to watch EDMX files in your Data project for changes and regenerate the framework. | | [InitCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/InitCommand) | Command for initializing EasyAF project configuration including database scaffolding, project types, and analyzer setup. | | [NewCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/NewCommand) | Creates a new EasyAF solution: the Core, Data, Business, Api, MessageBus, and Tests projects, referenced the way EasyAF expects, with the solution-level build files and an `.slnx`. | | [EdmxRootCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/EdmxRootCommand) | Root command for EDMX file utilities. | | [SetupCommand](/api-reference/CloudNimble/EasyAF/Tools/Commands/SetupCommand) | Command for setting up local development environment for existing EasyAF projects. | # CleanupResult Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Models/CleanupResult Represents the result of a cleanup operation. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Models.CleanupResult ``` ## Summary Represents the result of a cleanup operation. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public CleanupResult() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ErrorCount Gets or sets the number of errors encountered during deletion. #### Syntax ```csharp theme={"dark"} public int ErrorCount { get; set; } ``` #### Property Value Type: `int` ### ErrorMessage Gets or sets any error message if the operation failed. #### Syntax ```csharp theme={"dark"} public string ErrorMessage { get; set; } ``` #### Property Value Type: `string` ### FilesDeleted Gets or sets the number of files deleted. #### Syntax ```csharp theme={"dark"} public int FilesDeleted { get; set; } ``` #### Property Value Type: `int` ### Message Gets or sets the result message. #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string` ### OrphanedFilesFound Gets or sets the number of orphaned files found. #### Syntax ```csharp theme={"dark"} public int OrphanedFilesFound { get; set; } ``` #### Property Value Type: `int` ### Success Gets or sets whether the cleanup operation was successful. #### Syntax ```csharp theme={"dark"} public bool Success { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Models/index Summary of the CloudNimble.EasyAF.Tools.Models Namespace ## Types ### Classes | Name | Summary | | - | - | | [CleanupResult](/api-reference/CloudNimble/EasyAF/Tools/Models/CleanupResult) | Represents the result of a cleanup operation. | # ProjectDiscoveryService Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/ProjectDiscovery/ProjectDiscoveryService Service for discovering and analyzing .NET projects in a solution. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.ProjectDiscovery **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.ProjectDiscovery.ProjectDiscoveryService ``` ## Summary Service for discovering and analyzing .NET projects in a solution. ## Remarks This service scans for solution files, project files, and analyzes their configurations to identify projects that are eligible for documentation generation. It handles multi-targeting scenarios and determines the best documentation files to use. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ProjectDiscoveryService() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### AnalyzeProject Analyzes a single project file to extract project information. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Tools.ProjectDiscovery.ProjectInfo AnalyzeProject(string projectPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectPath` | `string` | The path to the project file. | #### Returns Type: `CloudNimble.EasyAF.Tools.ProjectDiscovery.ProjectInfo` The project information, or null if the project cannot be analyzed. ### DiscoverProjects Discovers all eligible projects in the specified directory. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DiscoverProjects(string rootDirectory, string specificProject = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `rootDirectory` | `string` | The root directory to search. | | `specificProject` | `string` | Optional specific project name to filter by. | #### Returns Type: `System.Collections.Generic.List` A collection of discovered project information. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FindSolutionFile Finds the solution file in the specified directory. #### Syntax ```csharp theme={"dark"} public string FindSolutionFile(string directory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `directory` | `string` | The directory to search. | #### Returns Type: `string` The path to the solution file, or null if not found. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ProjectInfo Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/ProjectDiscovery/ProjectInfo Represents information about a discovered project. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.ProjectDiscovery **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.ProjectDiscovery.ProjectInfo ``` ## Summary Represents information about a discovered project. ## Remarks This class contains metadata about a project file, including its path, target frameworks, output directories, and XML documentation settings. It is used by the project discovery system to identify eligible projects for documentation generation. ## Constructors ### .ctor Initializes a new instance of the ProjectInfo class. #### Syntax ```csharp theme={"dark"} public ProjectInfo() ``` ### .ctor Initializes a new instance of the ProjectInfo class with a project path. #### Syntax ```csharp theme={"dark"} public ProjectInfo(string projectPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `projectPath` | `string` | The path to the project file. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AssemblyName Gets or sets the assembly name for the project. #### Syntax ```csharp theme={"dark"} public string AssemblyName { get; set; } ``` #### Property Value Type: `string` ### DocumentationFile Gets or sets the XML documentation file path pattern. #### Syntax ```csharp theme={"dark"} public string DocumentationFile { get; set; } ``` #### Property Value Type: `string` ### GeneratesDocumentation Gets or sets whether this project generates XML documentation. #### Syntax ```csharp theme={"dark"} public bool GeneratesDocumentation { get; set; } ``` #### Property Value Type: `bool` ### IsTemplateProject Gets or sets whether this is a template project. #### Syntax ```csharp theme={"dark"} public bool IsTemplateProject { get; set; } ``` #### Property Value Type: `bool` ### IsTestProject Gets or sets whether this is a test project. #### Syntax ```csharp theme={"dark"} public bool IsTestProject { get; set; } ``` #### Property Value Type: `bool` ### IsToolProject Gets or sets whether this is a tool project. #### Syntax ```csharp theme={"dark"} public bool IsToolProject { get; set; } ``` #### Property Value Type: `bool` ### LatestTargetFramework Gets or sets the latest (highest version) target framework. #### Syntax ```csharp theme={"dark"} public string LatestTargetFramework { get; set; } ``` #### Property Value Type: `string` ### ProjectDirectory Gets or sets the project directory path. #### Syntax ```csharp theme={"dark"} public string ProjectDirectory { get; set; } ``` #### Property Value Type: `string` ### ProjectName Gets or sets the project name (without extension). #### Syntax ```csharp theme={"dark"} public string ProjectName { get; set; } ``` #### Property Value Type: `string` ### ProjectPath Gets or sets the full path to the project file. #### Syntax ```csharp theme={"dark"} public string ProjectPath { get; set; } ``` #### Property Value Type: `string` ### TargetFrameworks Gets the collection of target frameworks for this project. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List TargetFrameworks { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAllDocumentationFilePaths Gets all XML documentation file paths for all target frameworks. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary GetAllDocumentationFilePaths() ``` #### Returns Type: `System.Collections.Generic.Dictionary` A dictionary mapping target frameworks to documentation file paths. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetLatestDocumentationFilePath Gets the XML documentation file path for the latest target framework. #### Syntax ```csharp theme={"dark"} public string GetLatestDocumentationFilePath() ``` #### Returns Type: `string` The path to the XML documentation file, or empty string if not available. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ShouldIncludeInDocumentation Determines whether this project should be included in documentation generation. #### Syntax ```csharp theme={"dark"} public bool ShouldIncludeInDocumentation() ``` #### Returns Type: `bool` True if the project should be included; otherwise, false. ### ToString Override Returns a string representation of the project information. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the project name and target frameworks. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/ProjectDiscovery/index Summary of the CloudNimble.EasyAF.Tools.ProjectDiscovery Namespace ## Types ### Classes | Name | Summary | | - | - | | [ProjectDiscoveryService](/api-reference/CloudNimble/EasyAF/Tools/ProjectDiscovery/ProjectDiscoveryService) | Service for discovering and analyzing .NET projects in a solution. | | [ProjectInfo](/api-reference/CloudNimble/EasyAF/Tools/ProjectDiscovery/ProjectInfo) | Represents information about a discovered project. | # EmbeddedResourceWriter Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/EmbeddedResourceWriter Renders text files embedded in an assembly, replacing `{{Token}}` placeholders, and writes them to disk. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Scaffolding **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Scaffolding.EmbeddedResourceWriter ``` ## Summary Renders text files embedded in an assembly, replacing `{{Token}}` placeholders, and writes them to disk. ## Remarks Resources are expected to use path-preserving logical names (for example `Resources/Api/Program.cs`) so that folder names containing dots are not confused with nested folders. Tokens are replaced in a single pass, so a token value that itself looks like a token is written literally. A placeholder with no matching token is an error rather than something to ship. Line endings are normalized to [NewLine](https://learn.microsoft.com/dotnet/api/system.environment.newline). ## Constructors ### .ctor Initializes a new instance of the [EmbeddedResourceWriter](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/EmbeddedResourceWriter) class that reads the EasyAF Tools assembly's `Resources/` folder. #### Syntax ```csharp theme={"dark"} public EmbeddedResourceWriter(System.Collections.Generic.IReadOnlyDictionary tokens) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tokens` | `System.Collections.Generic.IReadOnlyDictionary` | The tokens that replace `{{Name}}` placeholders. | ### .ctor Initializes a new instance of the [EmbeddedResourceWriter](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/EmbeddedResourceWriter) class. #### Syntax ```csharp theme={"dark"} public EmbeddedResourceWriter(System.Collections.Generic.IReadOnlyDictionary tokens, System.Reflection.Assembly assembly, string rootFolder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tokens` | `System.Collections.Generic.IReadOnlyDictionary` | The tokens that replace `{{Name}}` placeholders. | | `assembly` | `System.Reflection.Assembly` | The assembly the resources are embedded in. | | `rootFolder` | `string` | The logical folder resource names are relative to. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Assembly Gets the assembly the resources are read from. #### Syntax ```csharp theme={"dark"} public System.Reflection.Assembly Assembly { get; } ``` #### Property Value Type: `System.Reflection.Assembly` ### ResourceNames Gets the names of the available resources, relative to [EmbeddedResourceWriter.RootFolder](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/EmbeddedResourceWriter#rootfolder), with forward slashes, sorted. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyList ResourceNames { get; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyList` ### RootFolder Gets the logical folder that resource names are relative to (for example `Resources`). #### Syntax ```csharp theme={"dark"} public string RootFolder { get; } ``` #### Property Value Type: `string` ### Tokens Gets the tokens that replace `{{Name}}` placeholders. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyDictionary Tokens { get; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyDictionary` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Render Renders a resource with its tokens replaced. #### Syntax ```csharp theme={"dark"} public string Render(string resourceName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `resourceName` | `string` | The resource name relative to [EmbeddedResourceWriter.RootFolder](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/EmbeddedResourceWriter#rootfolder), for example `Api/Program.cs`. | #### Returns Type: `string` The rendered text. #### Exceptions | Exception | Description | | - | - | | `FileNotFoundException` | Thrown when no resource with that name exists. | | `InvalidOperationException` | Thrown when the resource contains a placeholder with no matching token. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### WriteAsync Renders a resource and writes it to disk as UTF-8 without a byte order mark, creating parent directories and replacing any existing file. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task WriteAsync(string resourceName, string destinationPath, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `resourceName` | `string` | The resource name relative to [EmbeddedResourceWriter.RootFolder](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/EmbeddedResourceWriter#rootfolder). | | `destinationPath` | `string` | The file to write. | | `cancellationToken` | `System.Threading.CancellationToken` | A token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` The full path of the written file. #### Exceptions | Exception | Description | | - | - | | `FileNotFoundException` | Thrown when no resource with that name exists. | | `InvalidOperationException` | Thrown when the resource contains a placeholder with no matching token. Nothing is written. | # ProjectGraphConfigurator Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ProjectGraphConfigurator Applies a [ScaffoldProject](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldProject) description to a project file freshly created from an SDK te... ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Scaffolding **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Scaffolding.ProjectGraphConfigurator ``` ## Summary Applies a [ScaffoldProject](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldProject) description to a project file freshly created from an SDK template. ## Remarks The SDK templates always add `ImplicitUsings` and `Nullable` (the class library and console templates through computed symbols a caller cannot set, the web template unconditionally), so they are removed here and the solution's `Directory.Build.props` decides. Reference groups are written immediately after the leading `PropertyGroup`, `PackageReference` first, then `ProjectReference`, entries alphabetical, versions as attributes. ## Constructors ### .ctor Initializes a new instance of the [ProjectGraphConfigurator](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ProjectGraphConfigurator) class. #### Syntax ```csharp theme={"dark"} public ProjectGraphConfigurator(string solutionDirectory, string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `solutionDirectory` | `string` | The solution directory that contains one folder per project. | | `namespace` | `string` | The solution namespace that prefixes every project name. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Namespace Gets the solution namespace that prefixes every project name. #### Syntax ```csharp theme={"dark"} public string Namespace { get; } ``` #### Property Value Type: `string` ### SolutionDirectory Gets the solution directory that contains one folder per project. #### Syntax ```csharp theme={"dark"} public string SolutionDirectory { get; } ``` #### Property Value Type: `string` ## Methods ### Configure Configures the project file at `{SolutionDirectory}/{name}/{name}.csproj`. #### Syntax ```csharp theme={"dark"} public string Configure(CloudNimble.EasyAF.Tools.Scaffolding.ScaffoldProject project) ``` #### Parameters | Name | Type | Description | | - | - | - | | `project` | `CloudNimble.EasyAF.Tools.Scaffolding.ScaffoldProject` | The project description. | #### Returns Type: `string` The full path of the configured project file. #### Exceptions | Exception | Description | | - | - | | `FileNotFoundException` | Thrown when the project file does not exist. | | `InvalidOperationException` | Thrown when the project file cannot be loaded. | ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ScaffoldLayout Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldLayout Defines the projects, references, and packages of a scaffolded EasyAF solution. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Scaffolding **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Scaffolding.ScaffoldLayout ``` ## Summary Defines the projects, references, and packages of a scaffolded EasyAF solution. ## Remarks The graph is: ```csharp theme={"dark"} Data → Core Business → Core, Data Api → Business, Data, MessageBus.Core MessageBus.Core → Core MessageBus.Dispatch → Business, MessageBus.Core MessageBus.Runtime → Business, Data, MessageBus.Core, MessageBus.Dispatch Tests.Core → Core Tests.Business → Business, Data Tests.Api → Api ``` References to projects that are not created (because of `--no-api`, `--no-messagebus`, or `--no-runtime`) are dropped. ## Methods ### Create Creates the project list for the given options, in solution order. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IReadOnlyList Create(CloudNimble.EasyAF.Tools.Scaffolding.ScaffoldOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `CloudNimble.EasyAF.Tools.Scaffolding.ScaffoldOptions` | The validated scaffold options. | #### Returns Type: `System.Collections.Generic.IReadOnlyList` The projects to create. # ScaffoldOptions Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldOptions The validated inputs for `dotnet easyaf new`: the solution namespace, target framework, and which optional projects to include. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Scaffolding **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Scaffolding.ScaffoldOptions ``` ## Summary The validated inputs for `dotnet easyaf new`: the solution namespace, target framework, and which optional projects to include. ## Constructors ### .ctor Initializes a new instance of the [ScaffoldOptions](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldOptions) class. #### Syntax ```csharp theme={"dark"} public ScaffoldOptions(string namespace, string targetFramework = "net10.0", bool includeApi = true, bool includeMessageBus = true, bool includeRuntime = true, bool webJob = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `namespace` | `string` | The solution namespace; every dot-separated segment must be a C# identifier. | | `targetFramework` | `string` | The target framework: `net10.0` or `net11.0`. | | `includeApi` | `bool` | Whether to create the `.Api` project. | | `includeMessageBus` | `bool` | Whether to create the `.MessageBus.*` projects. | | `includeRuntime` | `bool` | Whether to create the `.MessageBus.Runtime` project. | | `webJob` | `bool` | Whether to stamp Azure WebJob publish metadata on the runtime. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when an argument is invalid or the flags conflict. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Company Gets the first namespace segment (for example `CloudNimble` for `CloudNimble.Contoso`), used for package metadata. #### Syntax ```csharp theme={"dark"} public string Company { get; } ``` #### Property Value Type: `string` ### IncludeApi Gets a value indicating whether the `.Api` project (and its test project) is created. #### Syntax ```csharp theme={"dark"} public bool IncludeApi { get; } ``` #### Property Value Type: `bool` ### IncludeMessageBus Gets a value indicating whether the `.MessageBus.*` projects are created. #### Syntax ```csharp theme={"dark"} public bool IncludeMessageBus { get; } ``` #### Property Value Type: `bool` ### IncludeRuntime Gets a value indicating whether the `.MessageBus.Runtime` project is created. Always [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when [ScaffoldOptions.IncludeMessageBus](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldOptions#includemessagebus) is [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). #### Syntax ```csharp theme={"dark"} public bool IncludeRuntime { get; } ``` #### Property Value Type: `bool` ### MicrosoftPackageVersion Gets the version that Microsoft.Extensions and EF Core packages float to for [ScaffoldOptions.TargetFramework](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldOptions#targetframework). #### Syntax ```csharp theme={"dark"} public string MicrosoftPackageVersion { get; } ``` #### Property Value Type: `string` ### Namespace Gets the solution namespace (for example `CloudNimble.Contoso`); every project name starts with it. #### Syntax ```csharp theme={"dark"} public string Namespace { get; } ``` #### Property Value Type: `string` ### Product Gets the last namespace segment (for example `Contoso`), used in class, configuration, and WebJob names. #### Syntax ```csharp theme={"dark"} public string Product { get; } ``` #### Property Value Type: `string` ### TargetFramework Gets the target framework moniker every project uses (for example `net10.0`). #### Syntax ```csharp theme={"dark"} public string TargetFramework { get; } ``` #### Property Value Type: `string` ### WebJob Gets a value indicating whether Azure WebJob publish metadata is stamped on the `.MessageBus.Runtime` project. #### Syntax ```csharp theme={"dark"} public bool WebJob { get; } ``` #### Property Value Type: `bool` ## Methods ### CreateTokens Creates the token values the embedded scaffold resources are rendered with. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyDictionary CreateTokens(string sdkVersion, int year) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sdkVersion` | `string` | The .NET SDK version to pin in `global.json`. | | `year` | `int` | The copyright year. | #### Returns Type: `System.Collections.Generic.IReadOnlyDictionary` The tokens keyed by placeholder name. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SdkTemplateHost Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SdkTemplateHost Instantiates the .NET SDK's built-in C# project templates (`classlib`, `web`, `console`) in-process through Microsoft.TemplateEngine, without spawning `dotne... ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Scaffolding **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Scaffolding.SdkTemplateHost ``` ## Summary Instantiates the .NET SDK's built-in C# project templates (`classlib`, `web`, `console`) in-process through Microsoft.TemplateEngine, without spawning `dotnet new`. ## Remarks Template packages are discovered the same way the SDK's own `BuiltInTemplatePackageProvider` finds them: `{dotnetRoot}/templates/{version}/*.nupkg`, where `{version}` is the highest folder whose major version matches the requested target framework. Template post-actions (such as restore) are not executed. ## Constructors ### .ctor Initializes a new instance of the [SdkTemplateHost](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SdkTemplateHost) class. #### Syntax ```csharp theme={"dark"} public SdkTemplateHost(string templatesRoot, string targetFramework) ``` #### Parameters | Name | Type | Description | | - | - | - | | `templatesRoot` | `string` | The folder containing versioned template package folders. | | `targetFramework` | `string` | The target framework moniker projects will be created for. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### SdkVersion Gets the version of the SDK that supplied the templates in [SdkTemplateHost.TemplateFolder](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SdkTemplateHost#templatefolder) (for example, `10.0.401`), or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when it can't be determined. #### Syntax ```csharp theme={"dark"} public string SdkVersion { get; } ``` #### Property Value Type: `string` #### Remarks The SDK installs its common project templates as `microsoft.dotnet.common.projecttemplates.{Major}.{Minor}.{SdkVersion}.nupkg`, so the version is read from that package name. ### TargetFramework Gets the target framework moniker projects are created for (for example, `net10.0`). #### Syntax ```csharp theme={"dark"} public string TargetFramework { get; } ``` #### Property Value Type: `string` ### TemplateFolder Gets the resolved template version folder (for example, `C:\Program Files\dotnet\templates\10.0.12`), or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when [SdkTemplateHost.TemplatesRoot](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SdkTemplateHost#templatesroot) has no folder for the target framework's major version. #### Syntax ```csharp theme={"dark"} public string TemplateFolder { get; } ``` #### Property Value Type: `string` ### TemplatesRoot Gets the folder containing versioned template package folders (normally `{dotnetRoot}/templates`). #### Syntax ```csharp theme={"dark"} public string TemplatesRoot { get; } ``` #### Property Value Type: `string` ## Methods ### CreateProjectAsync Creates a project from an SDK template. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CreateProjectAsync(string shortName, string projectName, string outputDirectory, bool overwrite = false, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `shortName` | `string` | The template short name: `classlib`, `web`, or `console`. | | `projectName` | `string` | The project name, which becomes the .csproj file name and default namespace. | | `outputDirectory` | `string` | The directory the project is written to. It must not exist or must be empty unless *overwrite* is set. | | `overwrite` | `bool` | When [`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), files already in *outputDirectory* may be replaced. The caller is expected to have asked the user first. | | `cancellationToken` | `System.Threading.CancellationToken` | A token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` The full path of the created .csproj file. #### Exceptions | Exception | Description | | - | - | | `TemplateNotFoundException` | Thrown when no matching C# project template exists on the machine. | | `InvalidOperationException` | Thrown when *outputDirectory* already contains files and *overwrite* is [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), or when the template engine reports a failure. | ### Dispose #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FindDotnetRoot Finds the .NET installation root that owns the `dotnet` host, checking `DOTNET_ROOT`, then `DOTNET_HOST_PATH`, then `dotnet` on the `PATH`. #### Syntax ```csharp theme={"dark"} public static string FindDotnetRoot() ``` #### Returns Type: `string` The .NET installation root. #### Exceptions | Exception | Description | | - | - | | `DirectoryNotFoundException` | Thrown when no installation root can be found. | ### FindTemplatesRoot Finds the `templates` folder of the .NET installation returned by [SdkTemplateHost.FindDotnetRoot](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SdkTemplateHost#finddotnetroot). #### Syntax ```csharp theme={"dark"} public static string FindTemplatesRoot() ``` #### Returns Type: `string` The full path of the templates folder. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMajorVersion Gets the major version of a target framework moniker (for example, `10` for `net10.0`). #### Syntax ```csharp theme={"dark"} public static int GetMajorVersion(string targetFramework) ``` #### Parameters | Name | Type | Description | | - | - | - | | `targetFramework` | `string` | The target framework moniker. | #### Returns Type: `int` The major version. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when the moniker is not in the form `netX.Y`. | ### GetMissingTemplatesAsync Finds which of the given C# project templates are not available, so a caller can fail before creating anything. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetMissingTemplatesAsync(System.Collections.Generic.IEnumerable shortNames, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `shortNames` | `System.Collections.Generic.IEnumerable` | The template short names to look for, such as `classlib`, `web`, and `console`. | | `cancellationToken` | `System.Threading.CancellationToken` | A token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task>` The short names with no matching C# project template, in the order given. Empty when all are available. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IDisposable # SolutionFileBuilder Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SolutionFileBuilder Builds a Visual Studio `.slnx` solution file in-process with Microsoft.VisualStudio.SolutionPersistence, placing projects and solution items into solution fo... ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Scaffolding **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Scaffolding.SolutionFileBuilder ``` ## Summary Builds a Visual Studio `.slnx` solution file in-process with Microsoft.VisualStudio.SolutionPersistence, placing projects and solution items into solution folders. ## Constructors ### .ctor Initializes a new instance of the [SolutionFileBuilder](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SolutionFileBuilder) class. #### Syntax ```csharp theme={"dark"} public SolutionFileBuilder(string solutionDirectory, string solutionName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `solutionDirectory` | `string` | The directory the solution file is written to. | | `solutionName` | `string` | The solution file name without extension. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BuildTypes Gets the build types (configurations) the solution declares, in the order they were added. Always starts with `Debug` and `Release`. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyList BuildTypes { get; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyList` ### SolutionDirectory Gets the directory the solution file is written to. Project and item paths are stored relative to it. #### Syntax ```csharp theme={"dark"} public string SolutionDirectory { get; } ``` #### Property Value Type: `string` ### SolutionName Gets the solution file name without extension. #### Syntax ```csharp theme={"dark"} public string SolutionName { get; } ``` #### Property Value Type: `string` ## Methods ### AddBuildType Adds a build type (configuration) such as `DEV`. Duplicates are ignored. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Tools.Scaffolding.SolutionFileBuilder AddBuildType(string buildType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `buildType` | `string` | The build type name. | #### Returns Type: `CloudNimble.EasyAF.Tools.Scaffolding.SolutionFileBuilder` The current instance for method chaining. ### AddProject Adds a project to a solution folder. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Tools.Scaffolding.SolutionFileBuilder AddProject(string solutionFolder, string projectFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `solutionFolder` | `string` | The solution folder, for example `Core` or `/Core/`. | | `projectFilePath` | `string` | The project file path; relative paths are resolved against [SolutionFileBuilder.SolutionDirectory](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SolutionFileBuilder#solutiondirectory). | #### Returns Type: `CloudNimble.EasyAF.Tools.Scaffolding.SolutionFileBuilder` The current instance for method chaining. #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown when the same project has already been added. | ### AddSolutionItem Adds a loose file (for example `Directory.Build.props`) to a solution folder. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.Tools.Scaffolding.SolutionFileBuilder AddSolutionItem(string solutionFolder, string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `solutionFolder` | `string` | The solution folder, for example `Solution Items`. | | `filePath` | `string` | The file path; relative paths are resolved against [SolutionFileBuilder.SolutionDirectory](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SolutionFileBuilder#solutiondirectory). | #### Returns Type: `CloudNimble.EasyAF.Tools.Scaffolding.SolutionFileBuilder` The current instance for method chaining. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SaveAsync Writes the solution file, replacing any existing file of the same name. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task SaveAsync(System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `cancellationToken` | `System.Threading.CancellationToken` | A token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` The full path of the written solution file. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TemplateNotFoundException Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/TemplateNotFoundException Thrown when a .NET SDK project template cannot be found in the installed SDK's templates folder. ## Definition **Assembly:** CloudNimble.EasyAF.Tools.dll **Namespace:** CloudNimble.EasyAF.Tools.Scaffolding **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.Tools.Scaffolding.TemplateNotFoundException ``` ## Summary Thrown when a .NET SDK project template cannot be found in the installed SDK's templates folder. ## Constructors ### .ctor Initializes a new instance of the [TemplateNotFoundException](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/TemplateNotFoundException) class. #### Syntax ```csharp theme={"dark"} public TemplateNotFoundException(string shortName, string searchedPath, string targetFramework) ``` #### Parameters | Name | Type | Description | | - | - | - | | `shortName` | `string` | The short name of the template that was requested. | | `searchedPath` | `string` | The folder that was searched for template packages. | | `targetFramework` | `string` | The target framework the template was requested for. | ## Properties ### SearchedPath Gets the folder that was searched for template packages. #### Syntax ```csharp theme={"dark"} public string SearchedPath { get; } ``` #### Property Value Type: `string` ### ShortName Gets the short name of the template that was requested (for example, `classlib`). #### Syntax ```csharp theme={"dark"} public string ShortName { get; } ``` #### Property Value Type: `string` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/index Summary of the CloudNimble.EasyAF.Tools.Scaffolding Namespace ## Types ### Classes | Name | Summary | | - | - | | [EmbeddedResourceWriter](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/EmbeddedResourceWriter) | Renders text files embedded in an assembly, replacing `{{Token}}` placeholders, and writes them to disk. | | [ProjectGraphConfigurator](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ProjectGraphConfigurator) | Applies a [ScaffoldProject](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldProject) description to a project file freshly created from an SDK template. | | [ScaffoldLayout](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldLayout) | Defines the projects, references, and packages of a scaffolded EasyAF solution. | | [ScaffoldOptions](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldOptions) | The validated inputs for `dotnet easyaf new`: the solution namespace, target framework, and which optional projects to include. | | [ScaffoldPackage](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldPackage) | A NuGet package reference for a scaffolded project. | | [ScaffoldProject](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/ScaffoldProject) | Describes one project in a scaffolded EasyAF solution: how it is created and how its project file is configured. | | [SdkTemplateHost](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SdkTemplateHost) | Instantiates the .NET SDK's built-in C# project templates (`classlib`, `web`, `console`) in-process through Microsoft.TemplateEngine, without spawning `dotnet new`. | | [SolutionFileBuilder](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/SolutionFileBuilder) | Builds a Visual Studio `.slnx` solution file in-process with Microsoft.VisualStudio.SolutionPersistence, placing projects and solution items into solution folders. | | [TemplateNotFoundException](/api-reference/CloudNimble/EasyAF/Tools/Scaffolding/TemplateNotFoundException) | Thrown when a .NET SDK project template cannot be found in the installed SDK's templates folder. | # AssemblyXmlDocumentation Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/AssemblyXmlDocumentation Represents the root XML documentation structure for a .NET assembly. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.AssemblyXmlDocumentation ``` ## Summary Represents the root XML documentation structure for a .NET assembly. ## Remarks This class parses and contains all the XML documentation for a single assembly, including all types, members, and their associated documentation elements. It provides methods to access and filter documentation by various criteria. ## Constructors ### .ctor Initializes a new instance of the XmlDocumentationDocument class. #### Syntax ```csharp theme={"dark"} public AssemblyXmlDocumentation() ``` ### .ctor Initializes a new instance of the XmlDocumentationDocument class from an XML document. #### Syntax ```csharp theme={"dark"} public AssemblyXmlDocumentation(System.Xml.Linq.XDocument xmlDocument) ``` #### Parameters | Name | Type | Description | | - | - | - | | `xmlDocument` | `System.Xml.Linq.XDocument` | The XML documentation to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AssemblyName Gets or sets the name of the assembly this documentation belongs to. #### Syntax ```csharp theme={"dark"} public string AssemblyName { get; set; } ``` #### Property Value Type: `string` ### Events Gets the collection of all documented events in the assembly. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Events { get; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### Fields Gets the collection of all documented fields in the assembly. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Fields { get; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### Members Gets the collection of all documented members in the assembly. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Members { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### Methods Gets the collection of all documented methods in the assembly. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Methods { get; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### Properties Gets the collection of all documented properties in the assembly. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Properties { get; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### Types Gets the collection of all documented types in the assembly. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Types { get; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMembersByType Gets all members belonging to a specific type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary GetMembersByType(string typeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `typeName` | `string` | The fully qualified type name (without T: prefix). | #### Returns Type: `System.Collections.Generic.Dictionary` A dictionary of members belonging to the specified type. ### GetNamespaces Gets all unique namespaces represented in the documentation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List GetNamespaces() ``` #### Returns Type: `System.Collections.Generic.List` A list of unique namespace names. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### GetTypesByNamespace Gets all types within a specific namespace. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary GetTypesByNamespace(string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `namespace` | `string` | The namespace to filter by. | #### Returns Type: `System.Collections.Generic.Dictionary` A dictionary of types in the specified namespace. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # MemberType Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/MemberType Enumeration of member types in XML documentation. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.MemberType ``` ## Summary Enumeration of member types in XML documentation. ## Values | Name | Value | Description | | - | - | - | | `Unknown` | 0 | Unknown member type. | | `Type` | 1 | Type (class, interface, struct, enum, delegate). | | `Method` | 2 | Method or constructor. | | `Property` | 3 | Property or indexer. | | `Field` | 4 | Field or constant. | | `Event` | 5 | Event. | | `Namespace` | 6 | Namespace. | # XmlCodeBlockElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlCodeBlockElement Represents a code block XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlCodeBlockElement ``` ## Summary Represents a code block XML documentation element. ## Remarks The code element contains code examples or snippets. It is typically rendered as a formatted code block with syntax highlighting. ## Constructors ### .ctor Initializes a new instance of the XmlCodeBlockElement class. #### Syntax ```csharp theme={"dark"} public XmlCodeBlockElement() ``` ### .ctor Initializes a new instance of the XmlCodeBlockElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlCodeBlockElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Language Gets or sets the programming language for syntax highlighting. #### Syntax ```csharp theme={"dark"} public string Language { get; set; } ``` #### Property Value Type: `string` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this code block element to MDX format with syntax highlighting. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this code block. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlCodeElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlCodeElement Represents an inline code XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlCodeElement ``` ## Summary Represents an inline code XML documentation element. ## Remarks The c element marks text as inline code within documentation. It is typically rendered with monospace font and different styling. ## Constructors ### .ctor Initializes a new instance of the XmlCodeElement class. #### Syntax ```csharp theme={"dark"} public XmlCodeElement() ``` ### .ctor Initializes a new instance of the XmlCodeElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlCodeElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this inline code element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this inline code. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlDocumentationElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlDocumentationElement Represents a base XML documentation element with common properties. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ``` ## Summary Represents a base XML documentation element with common properties. ## Remarks This abstract class provides the foundation for all XML documentation elements, including summary, remarks, parameters, returns, and other documentation tags. It handles parsing of XML content and preserves the original structure for conversion to MDX format. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Abstract Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlExampleElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlExampleElement Represents an example XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlExampleElement ``` ## Summary Represents an example XML documentation element. ## Remarks The example element contains code examples that demonstrate how to use a type or member. It can contain both description text and code blocks. ## Constructors ### .ctor Initializes a new instance of the XmlExampleElement class. #### Syntax ```csharp theme={"dark"} public XmlExampleElement() ``` ### .ctor Initializes a new instance of the XmlExampleElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlExampleElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this example element to MDX format with proper code formatting. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this example. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlExceptionElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlExceptionElement Represents an exception XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlExceptionElement ``` ## Summary Represents an exception XML documentation element. ## Remarks The exception element documents exceptions that can be thrown by a method or property. It includes the exception type and conditions under which it is thrown. ## Constructors ### .ctor Initializes a new instance of the XmlExceptionElement class. #### Syntax ```csharp theme={"dark"} public XmlExceptionElement() ``` ### .ctor Initializes a new instance of the XmlExceptionElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlExceptionElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Cref Gets or sets the fully qualified name of the exception type. #### Syntax ```csharp theme={"dark"} public string Cref { get; set; } ``` #### Property Value Type: `string` ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this exception element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this exception. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlGenericElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlGenericElement Represents a generic XML documentation element for unrecognized tags. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlGenericElement ``` ## Summary Represents a generic XML documentation element for unrecognized tags. ## Remarks This class handles XML documentation elements that don't have specific implementations. It provides basic text extraction and formatting capabilities for any XML element. ## Constructors ### .ctor Initializes a new instance of the XmlGenericElement class. #### Syntax ```csharp theme={"dark"} public XmlGenericElement() ``` ### .ctor Initializes a new instance of the XmlGenericElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlGenericElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ElementName Gets or sets the XML element name. #### Syntax ```csharp theme={"dark"} public string ElementName { get; set; } ``` #### Property Value Type: `string` ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this generic element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlListElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlListElement Represents a list XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlListElement ``` ## Summary Represents a list XML documentation element. ## Remarks The list element creates bulleted or numbered lists within documentation. It supports different list types including bullet, number, and table formats. ## Constructors ### .ctor Initializes a new instance of the XmlListElement class. #### Syntax ```csharp theme={"dark"} public XmlListElement() ``` ### .ctor Initializes a new instance of the XmlListElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlListElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ### Type Gets or sets the type of list (bullet, number, table). #### Syntax ```csharp theme={"dark"} public string Type { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this list element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this list. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlMember Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlMember Represents a documented member from XML documentation. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlMember ``` ## Summary Represents a documented member from XML documentation. ## Remarks This class contains all the documentation elements for a single member, including summary, remarks, parameters, return values, exceptions, and examples. It provides methods to convert the documentation to various formats. ## Constructors ### .ctor Initializes a new instance of the XmlMember class. #### Syntax ```csharp theme={"dark"} public XmlMember() ``` ### .ctor Initializes a new instance of the XmlMember class from an XML element. #### Syntax ```csharp theme={"dark"} public XmlMember(System.Xml.Linq.XElement memberElement) ``` #### Parameters | Name | Type | Description | | - | - | - | | `memberElement` | `System.Xml.Linq.XElement` | The XML member element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Examples Gets the collection of example documentation elements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Examples { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Exceptions Gets the collection of exception documentation elements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Exceptions { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### MemberType Gets or sets the member type (Type, Method, Property, Field, Event). #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.XmlDocumentation.MemberType MemberType { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.XmlDocumentation.MemberType` ### Name Gets or sets the full member name with prefix (e.g., T:System.String, M:System.String.Length). #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### Parameters Gets the collection of parameter documentation elements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Parameters { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Permissions Gets the collection of permission documentation elements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Permissions { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Remarks Gets or sets the remarks documentation element. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.XmlDocumentation.XmlRemarksElement Remarks { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.XmlDocumentation.XmlRemarksElement` ### Returns Gets or sets the returns documentation element. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.XmlDocumentation.XmlReturnsElement Returns { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.XmlDocumentation.XmlReturnsElement` ### SeeAlso Gets the collection of see also references. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List SeeAlso { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Summary Gets or sets the summary documentation element. #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.XmlDocumentation.XmlSummaryElement Summary { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.XmlDocumentation.XmlSummaryElement` ### TypeParameters Gets the collection of type parameter documentation elements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List TypeParameters { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Value Gets or sets the value documentation element (for properties). #### Syntax ```csharp theme={"dark"} public CloudNimble.EasyAF.XmlDocumentation.XmlValueElement Value { get; set; } ``` #### Property Value Type: `CloudNimble.EasyAF.XmlDocumentation.XmlValueElement` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetContainingType Gets the containing type name for members. #### Syntax ```csharp theme={"dark"} public string GetContainingType() ``` #### Returns Type: `string` The containing type name, or empty string for types. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetNamespace Gets the namespace of the member. #### Syntax ```csharp theme={"dark"} public string GetNamespace() ``` #### Returns Type: `string` The namespace name. ### GetSimpleName Gets the simple name of the member without prefix and namespace. #### Syntax ```csharp theme={"dark"} public string GetSimpleName() ``` #### Returns Type: `string` The simple member name. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlParagraphElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlParagraphElement Represents a paragraph XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlParagraphElement ``` ## Summary Represents a paragraph XML documentation element. ## Remarks The para element represents a paragraph break within documentation text. It is used to separate sections of content for better readability. ## Constructors ### .ctor Initializes a new instance of the XmlParagraphElement class. #### Syntax ```csharp theme={"dark"} public XmlParagraphElement() ``` ### .ctor Initializes a new instance of the XmlParagraphElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlParagraphElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this paragraph element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this paragraph. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlParamRefElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlParamRefElement Represents a paramref XML documentation element for parameter references. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlParamRefElement ``` ## Summary Represents a paramref XML documentation element for parameter references. ## Remarks The paramref element creates a reference to a parameter within the documentation. It is used to refer to parameters inline within text. ## Constructors ### .ctor Initializes a new instance of the XmlParamRefElement class. #### Syntax ```csharp theme={"dark"} public XmlParamRefElement() ``` ### .ctor Initializes a new instance of the XmlParamRefElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlParamRefElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Name Gets or sets the name of the referenced parameter. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this paramref element to MDX format as inline code. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this parameter reference. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlParameterElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlParameterElement Represents a parameter XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlParameterElement ``` ## Summary Represents a parameter XML documentation element. ## Remarks The param element describes a parameter of a method, constructor, or indexer. It includes the parameter name and description of its purpose and usage. ## Constructors ### .ctor Initializes a new instance of the XmlParameterElement class. #### Syntax ```csharp theme={"dark"} public XmlParameterElement() ``` ### .ctor Initializes a new instance of the XmlParameterElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlParameterElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Name Gets or sets the name of the parameter. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this parameter element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this parameter. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlPermissionElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlPermissionElement Represents a permission XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlPermissionElement ``` ## Summary Represents a permission XML documentation element. ## Remarks The permission element documents the security permissions required to access or use a particular type or member. ## Constructors ### .ctor Initializes a new instance of the XmlPermissionElement class. #### Syntax ```csharp theme={"dark"} public XmlPermissionElement() ``` ### .ctor Initializes a new instance of the XmlPermissionElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlPermissionElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Cref Gets or sets the permission type reference. #### Syntax ```csharp theme={"dark"} public string Cref { get; set; } ``` #### Property Value Type: `string` ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this permission element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this permission requirement. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlRemarksElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlRemarksElement Represents a remarks XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlRemarksElement ``` ## Summary Represents a remarks XML documentation element. ## Remarks The remarks element provides additional detailed information about a type or member. It is typically displayed after the summary and can contain more extensive explanations, usage notes, or implementation details. ## Constructors ### .ctor Initializes a new instance of the XmlRemarksElement class. #### Syntax ```csharp theme={"dark"} public XmlRemarksElement() ``` ### .ctor Initializes a new instance of the XmlRemarksElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlRemarksElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this remarks element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of these remarks. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlReturnsElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlReturnsElement Represents a returns XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlReturnsElement ``` ## Summary Represents a returns XML documentation element. ## Remarks The returns element describes the return value of a method or property. It explains what the method returns and under what conditions. ## Constructors ### .ctor Initializes a new instance of the XmlReturnsElement class. #### Syntax ```csharp theme={"dark"} public XmlReturnsElement() ``` ### .ctor Initializes a new instance of the XmlReturnsElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlReturnsElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this returns element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this returns description. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlSeeAlsoElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlSeeAlsoElement Represents a seealso XML documentation element for related references. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlSeeAlsoElement ``` ## Summary Represents a seealso XML documentation element for related references. ## Remarks The seealso element creates a link to related types or members. These are typically displayed in a "See Also" section. ## Constructors ### .ctor Initializes a new instance of the XmlSeeAlsoElement class. #### Syntax ```csharp theme={"dark"} public XmlSeeAlsoElement() ``` ### .ctor Initializes a new instance of the XmlSeeAlsoElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlSeeAlsoElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Cref Gets or sets the cross-reference target. #### Syntax ```csharp theme={"dark"} public string Cref { get; set; } ``` #### Property Value Type: `string` ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### LinkText Gets or sets the link text to display. #### Syntax ```csharp theme={"dark"} public string LinkText { get; set; } ``` #### Property Value Type: `string` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this seealso element to MDX format as a link. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this related reference. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlSeeElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlSeeElement Represents a see XML documentation element for cross-references. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlSeeElement ``` ## Summary Represents a see XML documentation element for cross-references. ## Remarks The see element creates a link to another type or member within the documentation. It is used for inline cross-references within text. ## Constructors ### .ctor Initializes a new instance of the XmlSeeElement class. #### Syntax ```csharp theme={"dark"} public XmlSeeElement() ``` ### .ctor Initializes a new instance of the XmlSeeElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlSeeElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Cref Gets or sets the cross-reference target. #### Syntax ```csharp theme={"dark"} public string Cref { get; set; } ``` #### Property Value Type: `string` ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### LinkText Gets or sets the link text to display. #### Syntax ```csharp theme={"dark"} public string LinkText { get; set; } ``` #### Property Value Type: `string` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this see element to MDX format as a link. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this cross-reference. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlSummaryElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlSummaryElement Represents a summary XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlSummaryElement ``` ## Summary Represents a summary XML documentation element. ## Remarks The summary element provides a brief description of a type or member. It is typically displayed prominently in documentation and should be concise but informative. ## Constructors ### .ctor Initializes a new instance of the XmlSummaryElement class. #### Syntax ```csharp theme={"dark"} public XmlSummaryElement() ``` ### .ctor Initializes a new instance of the XmlSummaryElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlSummaryElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this summary element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this summary. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlTypeParamRefElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlTypeParamRefElement Represents a typeparamref XML documentation element for type parameter references. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlTypeParamRefElement ``` ## Summary Represents a typeparamref XML documentation element for type parameter references. ## Remarks The typeparamref element creates a reference to a generic type parameter within the documentation. It is used to refer to type parameters inline within text. ## Constructors ### .ctor Initializes a new instance of the XmlTypeParamRefElement class. #### Syntax ```csharp theme={"dark"} public XmlTypeParamRefElement() ``` ### .ctor Initializes a new instance of the XmlTypeParamRefElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlTypeParamRefElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Name Gets or sets the name of the referenced type parameter. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this typeparamref element to MDX format as inline code. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this type parameter reference. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlTypeParameterElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlTypeParameterElement Represents a type parameter XML documentation element. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlTypeParameterElement ``` ## Summary Represents a type parameter XML documentation element. ## Remarks The typeparam element describes a generic type parameter. It includes the parameter name and description of its constraints and usage. ## Constructors ### .ctor Initializes a new instance of the XmlTypeParameterElement class. #### Syntax ```csharp theme={"dark"} public XmlTypeParameterElement() ``` ### .ctor Initializes a new instance of the XmlTypeParameterElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlTypeParameterElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Name Gets or sets the name of the type parameter. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this type parameter element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this type parameter. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # XmlValueElement Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlValueElement Represents a value XML documentation element for properties. ## Definition **Assembly:** CloudNimble.EasyAF.XmlDocumentation.dll **Namespace:** CloudNimble.EasyAF.XmlDocumentation **Inheritance:** CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement ## Syntax ```csharp theme={"dark"} CloudNimble.EasyAF.XmlDocumentation.XmlValueElement ``` ## Summary Represents a value XML documentation element for properties. ## Remarks The value element describes the value that a property represents. It is used primarily for properties to explain what the property value means. ## Constructors ### .ctor Initializes a new instance of the XmlValueElement class. #### Syntax ```csharp theme={"dark"} public XmlValueElement() ``` ### .ctor Initializes a new instance of the XmlValueElement class with XML content. #### Syntax ```csharp theme={"dark"} public XmlValueElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement() ``` ### .ctor Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Initializes a new instance of the XmlDocumentationElement class with XML content. #### Syntax ```csharp theme={"dark"} protected XmlDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to parse. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InnerElements Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the inner XML elements for nested content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List InnerElements { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### RawXml Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the raw XML content of the element. #### Syntax ```csharp theme={"dark"} public string RawXml { get; set; } ``` #### Property Value Type: `string` ### Text Inherited Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Gets or sets the parsed text content of the element. #### Syntax ```csharp theme={"dark"} public string Text { get; set; } ``` #### Property Value Type: `string` ## Methods ### CreateDocumentationElement Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Creates the appropriate documentation element based on the XML element name. #### Syntax ```csharp theme={"dark"} protected virtual CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement CreateDocumentationElement(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The XML element to convert. | #### Returns Type: `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` The appropriate documentation element, or null if not supported. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseInnerElements Inherited Virtual Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Parses inner XML elements recursively. #### Syntax ```csharp theme={"dark"} protected virtual void ParseInnerElements(System.Xml.Linq.XElement element) ``` #### Parameters | Name | Type | Description | | - | - | - | | `element` | `System.Xml.Linq.XElement` | The parent XML element to parse. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToMdx Override Converts this value element to MDX format. #### Syntax ```csharp theme={"dark"} public override string ToMdx() ``` #### Returns Type: `string` The MDX representation of this value description. ### ToMdx Inherited Abstract Inherited from `CloudNimble.EasyAF.XmlDocumentation.XmlDocumentationElement` Converts this element to MDX format. #### Syntax ```csharp theme={"dark"} public abstract string ToMdx() ``` #### Returns Type: `string` The MDX representation of this element. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/api-reference/CloudNimble/EasyAF/XmlDocumentation/index Summary of the CloudNimble.EasyAF.XmlDocumentation Namespace ## Types ### Classes | Name | Summary | | - | - | | [AssemblyXmlDocumentation](/api-reference/CloudNimble/EasyAF/XmlDocumentation/AssemblyXmlDocumentation) | Represents the root XML documentation structure for a .NET assembly. | | [XmlCodeBlockElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlCodeBlockElement) | Represents a code block XML documentation element. | | [XmlCodeElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlCodeElement) | Represents an inline code XML documentation element. | | [XmlDocumentationElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlDocumentationElement) | Represents a base XML documentation element with common properties. | | [XmlExampleElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlExampleElement) | Represents an example XML documentation element. | | [XmlExceptionElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlExceptionElement) | Represents an exception XML documentation element. | | [XmlGenericElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlGenericElement) | Represents a generic XML documentation element for unrecognized tags. | | [XmlListElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlListElement) | Represents a list XML documentation element. | | [XmlMember](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlMember) | Represents a documented member from XML documentation. | | [MemberType](/api-reference/CloudNimble/EasyAF/XmlDocumentation/MemberType) | Enumeration of member types in XML documentation. | | [XmlParagraphElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlParagraphElement) | Represents a paragraph XML documentation element. | | [XmlParameterElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlParameterElement) | Represents a parameter XML documentation element. | | [XmlParamRefElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlParamRefElement) | Represents a paramref XML documentation element for parameter references. | | [XmlPermissionElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlPermissionElement) | Represents a permission XML documentation element. | | [XmlRemarksElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlRemarksElement) | Represents a remarks XML documentation element. | | [XmlReturnsElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlReturnsElement) | Represents a returns XML documentation element. | | [XmlSeeAlsoElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlSeeAlsoElement) | Represents a seealso XML documentation element for related references. | | [XmlSeeElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlSeeElement) | Represents a see XML documentation element for cross-references. | | [XmlSummaryElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlSummaryElement) | Represents a summary XML documentation element. | | [XmlTypeParameterElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlTypeParameterElement) | Represents a type parameter XML documentation element. | | [XmlTypeParamRefElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlTypeParamRefElement) | Represents a typeparamref XML documentation element for type parameter references. | | [XmlValueElement](/api-reference/CloudNimble/EasyAF/XmlDocumentation/XmlValueElement) | Represents a value XML documentation element for properties. | ### Enums | Name | Summary | | - | - | | [MemberType](/api-reference/CloudNimble/EasyAF/XmlDocumentation/MemberType) | Enumeration of member types in XML documentation. | # EntitySetConfiguration Source: https://easyaf.dev/api-reference/Microsoft/AspNet/OData/Builder/EntitySetConfiguration Extension methods for EntitySetConfiguration from Microsoft.AspNetCore.OData ## Definition **Assembly:** Microsoft.AspNetCore.OData.dll **Namespace:** Microsoft.AspNet.OData.Builder ## Syntax ```csharp theme={"dark"} Microsoft.AspNet.OData.Builder.EntitySetConfiguration where T : CloudNimble.EasyAF.Core.DbObservableObject ``` ## Summary This type is defined in Microsoft.AspNetCore.OData. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnet.odata.builder.entitysetconfiguration\{t}) for more information about the rest of the API. ## Methods ### IgnoreAuditFields Extension Extension method from `Microsoft.Restier.Core.Model.EasyAF_Restier_IModelBuilderExtensions` Configures the entity set to ignore audit trail fields in the OData model. Dynamically removes DateCreated, DateUpdated, CreatedById, and UpdatedById properties based on implemented interfaces. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNet.OData.Builder.EntitySetConfiguration IgnoreAuditFields(Microsoft.AspNet.OData.Builder.EntitySetConfiguration configuration) where T : CloudNimble.EasyAF.Core.EasyObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `configuration` | `Microsoft.AspNet.OData.Builder.EntitySetConfiguration` | The entity set configuration to modify. | #### Returns Type: `Microsoft.AspNet.OData.Builder.EntitySetConfiguration` The entity set configuration for method chaining. #### Type Parameters * `T` - The entity type that inherits from EasyObservableObject. ### IgnoreTrackingFields Extension Extension method from `Microsoft.Restier.Core.Model.EasyAF_Restier_IModelBuilderExtensions` Configures the entity set to ignore DbObservableObject tracking fields in the OData model. Excludes IsChanged, IsGraphChanged, ShouldTrackChanges, and OriginalValues from the model. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNet.OData.Builder.EntitySetConfiguration IgnoreTrackingFields(Microsoft.AspNet.OData.Builder.EntitySetConfiguration configuration) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `configuration` | `Microsoft.AspNet.OData.Builder.EntitySetConfiguration` | The entity set configuration to modify. | #### Returns Type: `Microsoft.AspNet.OData.Builder.EntitySetConfiguration` The entity set configuration for method chaining. #### Type Parameters * `T` - The entity type that inherits from DbObservableObject. # Overview Source: https://easyaf.dev/api-reference/Microsoft/AspNet/OData/Builder/index Summary of the Microsoft.AspNet.OData.Builder Namespace ## Types # EntityTypeBuilder Source: https://easyaf.dev/api-reference/Microsoft/EntityFrameworkCore/Metadata/Builders/EntityTypeBuilder Extension methods for EntityTypeBuilder from Microsoft.EntityFrameworkCore ## Definition **Assembly:** Microsoft.EntityFrameworkCore.dll **Namespace:** Microsoft.EntityFrameworkCore.Metadata.Builders ## Syntax ```csharp theme={"dark"} Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder where T : CloudNimble.EasyAF.Core.DbObservableObject ``` ## Summary This type is defined in Microsoft.EntityFrameworkCore. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.metadata.builders.entitytypebuilder\{t}) for more information about the rest of the API. ## Methods ### IgnoreTrackingFields Extension Extension method from `Microsoft.EntityFrameworkCore.Metadata.Builders.DataEFCore_EntityTypeBuilderExtensions` Configures the entity type to ignore tracking fields defined in the [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) class. #### Syntax ```csharp theme={"dark"} public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder IgnoreTrackingFields(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder builder) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder` | The [EntityTypeBuilder\`1](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.metadata.builders.entitytypebuilder-1) used to configure the entity type. | #### Returns Type: `Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder` The same [EntityTypeBuilder\`1](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.metadata.builders.entitytypebuilder-1) instance so that multiple calls can be chained. #### Type Parameters * `T` - The type of the entity being configured. # Overview Source: https://easyaf.dev/api-reference/Microsoft/EntityFrameworkCore/Metadata/Builders/index Summary of the Microsoft.EntityFrameworkCore.Metadata.Builders Namespace ## Types # IConfiguration Source: https://easyaf.dev/api-reference/Microsoft/Extensions/Configuration/IConfiguration Extension methods for IConfiguration from Microsoft.Extensions.Configuration.Abstractions ## Definition **Assembly:** Microsoft.Extensions.Configuration.Abstractions.dll **Namespace:** Microsoft.Extensions.Configuration ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.Configuration.IConfiguration ``` ## Summary This type is defined in Microsoft.Extensions.Configuration.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfiguration) for more information about the rest of the API. ## Methods ### BindWithJsonNames Extension Extension method from `Microsoft.Extensions.Configuration.IConfigurationExtensions` Binds the configuration values to the specified instance using JSON property names for key mapping. This method respects [JsonPropertyNameAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonpropertynameattribute) when determining configuration keys, allowing for JSON-style configuration binding with different property naming conventions. #### Syntax ```csharp theme={"dark"} public static void BindWithJsonNames(Microsoft.Extensions.Configuration.IConfiguration configuration, T instance) ``` #### Parameters | Name | Type | Description | | - | - | - | | `configuration` | `Microsoft.Extensions.Configuration.IConfiguration` | The configuration instance to bind from. | | `instance` | `T` | The instance to bind the configuration values to. | #### Type Parameters * `T` - The type of the instance to bind the configuration values to. #### Examples ```csharp theme={"dark"} public class MyConfig { [JsonPropertyName("api_endpoint")] public string ApiEndpoint { get; set; } public int Port { get; set; } } var config = new MyConfig(); configuration.BindWithJsonNames(config); // Looks for "api_endpoint" and "Port" in configuration ``` #### Remarks This method supports automatic type conversion for common types including DateTime, DateTimeOffset, and all types supported by [Type)](https://learn.microsoft.com/dotnet/api/system.convert.changetype\(system.object,system.type\)). If a property has a [JsonPropertyNameAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonpropertynameattribute), the attribute's Name value is used as the configuration key; otherwise, the property name is used directly. # Overview Source: https://easyaf.dev/api-reference/Microsoft/Extensions/Configuration/index Summary of the Microsoft.Extensions.Configuration Namespace ## Types # IHttpClientBuilder Source: https://easyaf.dev/api-reference/Microsoft/Extensions/DependencyInjection/IHttpClientBuilder Extension methods for IHttpClientBuilder from Microsoft.Extensions.Http ## Definition **Assembly:** Microsoft.Extensions.Http.dll **Namespace:** Microsoft.Extensions.DependencyInjection ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.DependencyInjection.IHttpClientBuilder ``` ## Summary This type is defined in Microsoft.Extensions.Http. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.ihttpclientbuilder) for more information about the rest of the API. ## Methods ### AddHttpMessageHandler Extension Extension method from `Microsoft.Extensions.DependencyInjection.EasyAF_Http_IHttpClientBuilderExtensions` Given the [HttpHandlerMode](/api-reference/CloudNimble/EasyAF/Core/HttpHandlerMode), adds the specified *THandler* to the beginning or end of the pipeline. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpMessageHandler(Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, CloudNimble.EasyAF.Core.HttpHandlerMode mode) where THandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.DependencyInjection.IHttpClientBuilder` | The [IHttpClientBuilder](/api-reference/Microsoft/Extensions/DependencyInjection/IHttpClientBuilder) instance to extend. | | `mode` | `CloudNimble.EasyAF.Core.HttpHandlerMode` | A [HttpHandlerMode](/api-reference/CloudNimble/EasyAF/Core/HttpHandlerMode) specifying whether we are making this handler the first one in the pipeline, or the last. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IHttpClientBuilder` The IHttpClientBuilder instance for method chaining. #### Type Parameters * `THandler` - The [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) type to pull from the scoped [ServiceProvider](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.serviceprovider). # IServiceCollection Source: https://easyaf.dev/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection Extension methods for IServiceCollection from Microsoft.Extensions.DependencyInjection.Abstractions ## Definition **Assembly:** Microsoft.Extensions.DependencyInjection.Abstractions.dll **Namespace:** Microsoft.Extensions.DependencyInjection ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.DependencyInjection.IServiceCollection ``` ## Summary This type is defined in Microsoft.Extensions.DependencyInjection.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) for more information about the rest of the API. ## Methods ### AddConfigurationBase Extension Extension method from `Microsoft.Extensions.DependencyInjection.EasyAF_Configuration_IServiceCollectionExtensions` Adds a configuration class that inherits from [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase) to the service collection. The configuration is bound from the specified configuration section and registered as both the specific type and the base [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase) type for dependency injection. #### Syntax ```csharp theme={"dark"} public static TConfiguration AddConfigurationBase(Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration, string configSectionName) where TConfiguration : CloudNimble.EasyAF.Configuration.ConfigurationBase ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection to add the configuration to. | | `configuration` | `Microsoft.Extensions.Configuration.IConfiguration` | The configuration instance to bind from. | | `configSectionName` | `string` | The name of the configuration section to bind from. | #### Returns Type: `TConfiguration` The bound configuration instance for immediate use or further configuration. #### Type Parameters * `TConfiguration` - The type of configuration class that inherits from [ConfigurationBase](/api-reference/CloudNimble/EasyAF/Configuration/ConfigurationBase). #### Examples ```csharp theme={"dark"} // In Program.cs or Startup.cs var myConfig = builder.Services.AddConfigurationBase<MyAppConfiguration>( builder.Configuration, "AppSettings" ); // The configuration can now be injected as either type: // [Inject] public MyAppConfiguration Config { get; set; } // [Inject] public ConfigurationBase BaseConfig { get; set; } ``` ### AddHttpClients Extension Extension method from `Microsoft.Extensions.DependencyInjection.EasyAF_Http_IServiceCollectionExtensions` Adds HTTP clients to the service collection based on configuration properties marked with [HttpEndpointAttribute](/api-reference/CloudNimble/EasyAF/Configuration/HttpEndpointAttribute). Uses the default HttpHandlerMode from the configuration. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpClients(Microsoft.Extensions.DependencyInjection.IServiceCollection services, TConfig config) where TConfig : CloudNimble.EasyAF.Configuration.ConfigurationBase where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection to add HTTP clients to. | | `config` | `TConfig` | The configuration instance containing endpoint definitions. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for method chaining. #### Type Parameters * `TConfig` - The configuration type that contains HTTP endpoint definitions. * `TMessageHandler` - The type of message handler to add to the HTTP clients. ### AddHttpClients Extension Extension method from `Microsoft.Extensions.DependencyInjection.EasyAF_Http_IServiceCollectionExtensions` Adds HTTP clients to the service collection based on configuration properties marked with [HttpEndpointAttribute](/api-reference/CloudNimble/EasyAF/Configuration/HttpEndpointAttribute). Allows explicit specification of the HttpHandlerMode for message handler configuration. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpClients(Microsoft.Extensions.DependencyInjection.IServiceCollection services, TConfig config, CloudNimble.EasyAF.Core.HttpHandlerMode httpHandlerMode) where TConfig : CloudNimble.EasyAF.Configuration.ConfigurationBase where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection to add HTTP clients to. | | `config` | `TConfig` | The configuration instance containing endpoint definitions. | | `httpHandlerMode` | `CloudNimble.EasyAF.Core.HttpHandlerMode` | Specifies how message handlers should be configured for the HTTP clients. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for method chaining. #### Type Parameters * `TConfig` - The configuration type that contains HTTP endpoint definitions. * `TMessageHandler` - The type of message handler to add to the HTTP clients. #### Examples ```csharp theme={"dark"} // Register HTTP clients with custom message handler services.AddHttpClients<MyConfiguration, MyAuthHandler>(config, HttpHandlerMode.Add); // This will automatically register HttpClient instances for all properties // in MyConfiguration that are marked with [HttpEndpoint] ``` # Overview Source: https://easyaf.dev/api-reference/Microsoft/Extensions/DependencyInjection/index Summary of the Microsoft.Extensions.DependencyInjection Namespace ## Types # IEnumerable Source: https://easyaf.dev/api-reference/System/Collections/Generic/IEnumerable Extension methods for IEnumerable from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System.Collections.Generic ## Syntax ```csharp theme={"dark"} System.Collections.Generic.IEnumerable where T : CloudNimble.EasyAF.Core.DbObservableObject ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable\{t}) for more information about the rest of the API. ## Methods ### AcceptChanges Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Loops through the entries in a given [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) and accepts all current changes for each entry. #### Syntax ```csharp theme={"dark"} public static void AcceptChanges(System.Collections.Generic.IEnumerable enumerable, bool goDeep = false) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | - | | `goDeep` | `bool` | - | ### ChangedCount Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a [Int32](https://learn.microsoft.com/dotnet/api/system.int32) representing the number of objects in the enumerable that have changes. #### Syntax ```csharp theme={"dark"} public static int ChangedCount(System.Collections.Generic.IEnumerable enumerable, bool checkGraph = false) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | - | | `checkGraph` | `bool` | - | #### Returns Type: `int` ### ContainsId Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) if a list of `Id`s from the given [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) contains the specified value. #### Syntax ```csharp theme={"dark"} public static bool ContainsId(System.Collections.Generic.IEnumerable list, TId idValue) where T : class, CloudNimble.EasyAF.Core.IIdentifiable where TId : struct, System.ValueType ``` #### Parameters | Name | Type | Description | | - | - | - | | `list` | `System.Collections.Generic.IEnumerable` | The [List\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) to check for the given ID value. | | `idValue` | `TId` | The value to check for. | #### Returns Type: `bool` ### ContentsAreChanged Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) if any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) in the [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) has changes. #### Syntax ```csharp theme={"dark"} public static bool ContentsAreChanged(System.Collections.Generic.IEnumerable enumerable, bool checkGraph = false) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | - | | `checkGraph` | `bool` | - | #### Returns Type: `bool` ### ContentsAreChanged Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) if any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) in the [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) has changes. #### Syntax ```csharp theme={"dark"} public static bool ContentsAreChanged(System.Collections.Generic.IEnumerable enumerable, System.Func predicate, bool checkGraph = false) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | - | | `predicate` | `System.Func` | - | | `checkGraph` | `bool` | - | #### Returns Type: `bool` ### ContentsAreChanged Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) if any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject) in the [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) has changes. #### Syntax ```csharp theme={"dark"} public static bool ContentsAreChanged(System.Collections.Generic.IEnumerable enumerable, System.Collections.Generic.IEnumerable foreignList, System.Func foreignIdFunc, bool checkGraph = false) where T : CloudNimble.EasyAF.Core.DbObservableObject, CloudNimble.EasyAF.Core.IIdentifiable where TForeign : CloudNimble.EasyAF.Core.DbObservableObject, CloudNimble.EasyAF.Core.IIdentifiable where TId : struct, System.ValueType ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | - | | `foreignList` | `System.Collections.Generic.IEnumerable` | The list of related objects that we want to filter the *enumerable* down to. | | `foreignIdFunc` | `System.Func` | The property from the *enumerable* that points to the `Id` for the objects in *foreignList*. | | `checkGraph` | `bool` | - | #### Returns Type: `bool` ### FilterForChanges Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` For a given [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), filter down the result to the changed items in *enumerable* whose foreign keys appear in the *foreignList*. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable FilterForChanges(System.Collections.Generic.IEnumerable enumerable, System.Collections.Generic.IEnumerable foreignList, System.Func foreignIdFunc) where T : CloudNimble.EasyAF.Core.DbObservableObject, CloudNimble.EasyAF.Core.IIdentifiable where TForeign : CloudNimble.EasyAF.Core.DbObservableObject, CloudNimble.EasyAF.Core.IIdentifiable where TId : struct, System.ValueType ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | The list we want to check for changes in. | | `foreignList` | `System.Collections.Generic.IEnumerable` | The list of related objects that we want to filter the *enumerable* down to. | | `foreignIdFunc` | `System.Func` | The property from the *enumerable* that points to the `Id` for the objects in *foreignList*. | #### Returns Type: `System.Collections.Generic.IEnumerable` ### None Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not the [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) has any items in it. #### Syntax ```csharp theme={"dark"} public static bool None(System.Collections.Generic.IEnumerable source) ``` #### Parameters | Name | Type | Description | | - | - | - | | `source` | `System.Collections.Generic.IEnumerable` | The [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) to check. | #### Returns Type: `bool` #### Type Parameters * `T` - The type of the items inside the [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable). ### None Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not the [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) has any items in it. #### Syntax ```csharp theme={"dark"} public static bool None(System.Collections.Generic.IEnumerable source, System.Func predicate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `source` | `System.Collections.Generic.IEnumerable` | The [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) to check. | | `predicate` | `System.Func` | A set of additional parameters to check against. | #### Returns Type: `bool` #### Type Parameters * `T` - The type of the items inside the [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable). ### RejectChanges Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Loops through the entries in a given [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) and clears all current changes for each entry. #### Syntax ```csharp theme={"dark"} public static void RejectChanges(System.Collections.Generic.IEnumerable enumerable, bool goDeep = false) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | - | | `goDeep` | `bool` | - | ### ToTrackedList Extension Extension method from `System.Collections.Generic.EasyAF_IEnumerableExtensions` Returns a \[List`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) where the [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject)DbObservableObjects have `Boolean)\` turned on. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.List ToTrackedList(System.Collections.Generic.IEnumerable enumerable, bool deepTracking = false) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `enumerable` | `System.Collections.Generic.IEnumerable` | The list of objects to turn change tracking on for. | | `deepTracking` | `bool` | - | #### Returns Type: `System.Collections.Generic.List` # IList Source: https://easyaf.dev/api-reference/System/Collections/Generic/IList Extension methods for IList from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System.Collections.Generic ## Syntax ```csharp theme={"dark"} System.Collections.Generic.IList where T : CloudNimble.EasyAF.Core.DbObservableObject ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist\{t}) for more information about the rest of the API. ## Methods ### ReplaceTracked Extension Extension method from `System.Collections.Generic.EasyAF_ListExtensions` #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IList ReplaceTracked(System.Collections.Generic.IList list, T oldInstance, T newInstance) where T : CloudNimble.EasyAF.Core.DbObservableObject ``` #### Parameters | Name | Type | Description | | - | - | - | | `list` | `System.Collections.Generic.IList` | - | | `oldInstance` | `T` | - | | `newInstance` | `T` | - | #### Returns Type: `System.Collections.Generic.IList` #### Type Parameters * `T` - # Overview Source: https://easyaf.dev/api-reference/System/Collections/Generic/index Summary of the System.Collections.Generic Namespace ## Types # Collection Source: https://easyaf.dev/api-reference/System/Collections/ObjectModel/Collection Extension methods for Collection from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System.Collections.ObjectModel ## Syntax ```csharp theme={"dark"} System.Collections.ObjectModel.Collection ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection\{t}) for more information about the rest of the API. ## Methods ### AddRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void AddRange(System.Collections.ObjectModel.Collection collection, System.Collections.Generic.IEnumerable items) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.Collection` | - | | `items` | `System.Collections.Generic.IEnumerable` | - | ### InsertRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void InsertRange(System.Collections.ObjectModel.Collection collection, int index, System.Collections.Generic.IEnumerable items) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.Collection` | - | | `index` | `int` | - | | `items` | `System.Collections.Generic.IEnumerable` | - | ### RemoveRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void RemoveRange(System.Collections.ObjectModel.Collection collection, int index, int count) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.Collection` | - | | `index` | `int` | - | | `count` | `int` | - | ### ReplaceRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void ReplaceRange(System.Collections.ObjectModel.Collection collection, int index, int count, System.Collections.Generic.IEnumerable items) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.Collection` | - | | `index` | `int` | - | | `count` | `int` | - | | `items` | `System.Collections.Generic.IEnumerable` | - | # CollectionChangeNotificationMode Source: https://easyaf.dev/api-reference/System/Collections/ObjectModel/CollectionChangeNotificationMode Specifies how bulk-change notifications are raised on an [ObservableCollection`1](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.obser... ## Definition **Assembly:** CloudNimble.EasyAF.Extensions.Collections.dll **Namespace:** System.Collections.ObjectModel **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} System.Collections.ObjectModel.CollectionChangeNotificationMode ``` ## Summary Specifies how bulk-change notifications are raised on an [ObservableCollection\`1](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1). ## Values | Name | Value | Description | | - | - | - | | `Batched` | 0 | Raises a single event with the proper action (Add, Remove, or Replace) | | and populates NewItems/OldItems with all affected items. | | | | `Reset` | 1 | Raises a single event. | | Compatible with all UI frameworks including WPF. | | | # ObservableCollection Source: https://easyaf.dev/api-reference/System/Collections/ObjectModel/ObservableCollection Extension methods for ObservableCollection from System.ObjectModel ## Definition **Assembly:** System.ObjectModel.dll **Namespace:** System.Collections.ObjectModel ## Syntax ```csharp theme={"dark"} System.Collections.ObjectModel.ObservableCollection ``` ## Summary This type is defined in System.ObjectModel. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection\{t}) for more information about the rest of the API. ## Methods ### AddRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void AddRange(System.Collections.ObjectModel.ObservableCollection collection, System.Collections.Generic.IEnumerable items, System.Collections.ObjectModel.CollectionChangeNotificationMode mode = 0) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.ObservableCollection` | - | | `items` | `System.Collections.Generic.IEnumerable` | - | | `mode` | `System.Collections.ObjectModel.CollectionChangeNotificationMode` | - | ### InsertRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void InsertRange(System.Collections.ObjectModel.ObservableCollection collection, int index, System.Collections.Generic.IEnumerable items, System.Collections.ObjectModel.CollectionChangeNotificationMode mode = 0) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.ObservableCollection` | - | | `index` | `int` | - | | `items` | `System.Collections.Generic.IEnumerable` | - | | `mode` | `System.Collections.ObjectModel.CollectionChangeNotificationMode` | - | ### RemoveRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void RemoveRange(System.Collections.ObjectModel.ObservableCollection collection, int index, int count, System.Collections.ObjectModel.CollectionChangeNotificationMode mode = 0) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.ObservableCollection` | - | | `index` | `int` | - | | `count` | `int` | - | | `mode` | `System.Collections.ObjectModel.CollectionChangeNotificationMode` | - | ### ReplaceRange Extension Extension method from `System.Collections.ObjectModel.EasyAF_CollectionExtensions` #### Syntax ```csharp theme={"dark"} public static void ReplaceRange(System.Collections.ObjectModel.ObservableCollection collection, int index, int count, System.Collections.Generic.IEnumerable items, System.Collections.ObjectModel.CollectionChangeNotificationMode mode = 0) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `System.Collections.ObjectModel.ObservableCollection` | - | | `index` | `int` | - | | `count` | `int` | - | | `items` | `System.Collections.Generic.IEnumerable` | - | | `mode` | `System.Collections.ObjectModel.CollectionChangeNotificationMode` | - | # Overview Source: https://easyaf.dev/api-reference/System/Collections/ObjectModel/index Summary of the System.Collections.ObjectModel Namespace ## Types ### Classes | Name | Summary | | - | - | | [CollectionChangeNotificationMode](/api-reference/System/Collections/ObjectModel/CollectionChangeNotificationMode) | Specifies how bulk-change notifications are raised on an [ObservableCollection\`1](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1). | ### Enums | Name | Summary | | - | - | | [CollectionChangeNotificationMode](/api-reference/System/Collections/ObjectModel/CollectionChangeNotificationMode) | Specifies how bulk-change notifications are raised on an [ObservableCollection\`1](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1). | # DateTime Source: https://easyaf.dev/api-reference/System/DateTime Extension methods for DateTime from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.DateTime ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.datetime) for more information about the rest of the API. ## Methods ### DaysInMonth Extension Extension method from `System.EasyAF_DateTimeExtensions` #### Syntax ```csharp theme={"dark"} public static int DaysInMonth(System.DateTime value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `System.DateTime` | - | #### Returns Type: `int` #### Remarks [https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object](https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object) ### FirstDayOfMonth Extension Extension method from `System.EasyAF_DateTimeExtensions` #### Syntax ```csharp theme={"dark"} public static System.DateTime FirstDayOfMonth(System.DateTime value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `System.DateTime` | - | #### Returns Type: `System.DateTime` #### Remarks [https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object](https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object) ### GetQuarter Extension Extension method from `System.EasyAF_DateTimeExtensions` Calculates the quarter for the given [DateTime](/api-reference/System/DateTime), assuming a calendar-based fiscal year. #### Syntax ```csharp theme={"dark"} public static int GetQuarter(System.DateTime date) ``` #### Parameters | Name | Type | Description | | - | - | - | | `date` | `System.DateTime` | The [DateTime](/api-reference/System/DateTime) to use in the calculation. | #### Returns Type: `int` #### Remarks From [https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date](https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date) ### GetQuarter Extension Extension method from `System.EasyAF_DateTimeExtensions` Calculates the quarter for the given [DateTime](/api-reference/System/DateTime), assuming a the provided fiscal year begin date. #### Syntax ```csharp theme={"dark"} public static int GetQuarter(System.DateTime date, System.DateTime fiscalYearStart) ``` #### Parameters | Name | Type | Description | | - | - | - | | `date` | `System.DateTime` | The [DateTime](/api-reference/System/DateTime) to use in the calculation. | | `fiscalYearStart` | `System.DateTime` | The [DateTime](/api-reference/System/DateTime) representing the start day of the fiscal year to use in calculation. | #### Returns Type: `int` #### Remarks From [https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date](https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date) ### LastDayOfMonth Extension Extension method from `System.EasyAF_DateTimeExtensions` #### Syntax ```csharp theme={"dark"} public static System.DateTime LastDayOfMonth(System.DateTime value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `System.DateTime` | - | #### Returns Type: `System.DateTime` #### Remarks [https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object](https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object) # DateTimeOffset Source: https://easyaf.dev/api-reference/System/DateTimeOffset Extension methods for DateTimeOffset from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.DateTimeOffset ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.datetimeoffset) for more information about the rest of the API. ## Methods ### DaysInMonth Extension Extension method from `System.EasyAF_DateTimeExtensions` #### Syntax ```csharp theme={"dark"} public static int DaysInMonth(System.DateTimeOffset value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `System.DateTimeOffset` | - | #### Returns Type: `int` #### Remarks [https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object](https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object) ### FirstDayOfMonth Extension Extension method from `System.EasyAF_DateTimeExtensions` #### Syntax ```csharp theme={"dark"} public static System.DateTimeOffset FirstDayOfMonth(System.DateTimeOffset value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `System.DateTimeOffset` | - | #### Returns Type: `System.DateTimeOffset` #### Remarks [https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object](https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object) ### GetQuarter Extension Extension method from `System.EasyAF_DateTimeExtensions` Calculates the quarter for the given [DateTimeOffset](/api-reference/System/DateTimeOffset), assuming a calendar-based fiscal year. #### Syntax ```csharp theme={"dark"} public static int GetQuarter(System.DateTimeOffset date) ``` #### Parameters | Name | Type | Description | | - | - | - | | `date` | `System.DateTimeOffset` | The [DateTimeOffset](/api-reference/System/DateTimeOffset) to use in the calculation. | #### Returns Type: `int` #### Remarks From [https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date](https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date) ### GetQuarter Extension Extension method from `System.EasyAF_DateTimeExtensions` Calculates the quarter for the given [DateTimeOffset](/api-reference/System/DateTimeOffset), assuming a the provided fiscal year begin date. #### Syntax ```csharp theme={"dark"} public static int GetQuarter(System.DateTimeOffset date, System.DateTimeOffset fiscalYearStart) ``` #### Parameters | Name | Type | Description | | - | - | - | | `date` | `System.DateTimeOffset` | The [DateTimeOffset](/api-reference/System/DateTimeOffset) to use in the calculation. | | `fiscalYearStart` | `System.DateTimeOffset` | The [DateTime](/api-reference/System/DateTime) representing the start day of the fiscal year to use in calculation. | #### Returns Type: `int` #### Remarks From [https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date](https://stackoverflow.com/questions/8698303/how-do-i-discover-the-quarter-of-a-given-date) ### LastDayOfMonth Extension Extension method from `System.EasyAF_DateTimeExtensions` #### Syntax ```csharp theme={"dark"} public static System.DateTimeOffset LastDayOfMonth(System.DateTimeOffset value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `System.DateTimeOffset` | - | #### Returns Type: `System.DateTimeOffset` #### Remarks [https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object](https://stackoverflow.com/questions/24245523/getting-the-first-and-last-day-of-a-month-using-a-given-datetime-object) # Exception Source: https://easyaf.dev/api-reference/System/Exception Extension methods for Exception from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.Exception ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.exception) for more information about the rest of the API. ## Methods ### TraceDemystifiedException Extension Extension method from `System.EasyAF_ExceptionExtensions` Demystifies the Exception and writes it to [Object\[\])](https://learn.microsoft.com/dotnet/api/system.diagnostics.trace.traceerror\(system.string,system.object\[]\)). #### Syntax ```csharp theme={"dark"} public static System.Exception TraceDemystifiedException(System.Exception ex, string logPrefix = "") ``` #### Parameters | Name | Type | Description | | - | - | - | | `ex` | `System.Exception` | The exception instance to manipulate. | | `logPrefix` | `string` | A string that will be prepended to the log entry. Defaults to the calling function name. | #### Returns Type: `System.Exception` The Demystified exception. # Guid Source: https://easyaf.dev/api-reference/System/Guid Extension methods for Guid from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.Guid ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.guid) for more information about the rest of the API. ## Methods ### ToComparableString Extension Extension method from `System.EasyAF_GuidExtensions` A little syntactical sugar to make sure GUIDs are outputted to a format that ensures accurate string comparisons. #### Syntax ```csharp theme={"dark"} public static string ToComparableString(System.Guid instance) ``` #### Parameters | Name | Type | Description | | - | - | - | | `instance` | `System.Guid` | The Guid to convert. | #### Returns Type: `string` An upper-case string representing the GUID instance to be compared. #### Remarks See [https://msdn.microsoft.com/en-us/library/bb386042.aspx](https://msdn.microsoft.com/en-us/library/bb386042.aspx) for more details. # HttpResponseMessage Source: https://easyaf.dev/api-reference/System/Net/Http/HttpResponseMessage Extension methods for HttpResponseMessage from System.Net.Http ## Definition **Assembly:** System.Net.Http.dll **Namespace:** System.Net.Http ## Syntax ```csharp theme={"dark"} System.Net.Http.HttpResponseMessage ``` ## Summary This type is defined in System.Net.Http. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage) for more information about the rest of the API. ## Methods ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_NewtonsoftJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to the specified type using Newtonsoft.Json with default settings. Returns either the deserialized response or error content as a string. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(T, string)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | #### Returns Type: `System.Threading.Tasks.Task<(T, string)>` A tuple containing either the deserialized response object or error content string. #### Type Parameters * `T` - The type to deserialize the response content to. ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_NewtonsoftJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to the specified type using Newtonsoft.Json with custom settings. Automatically configures SystemTextJsonContractResolver if not already set. Returns either the deserialized response or error content as a string. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(T, string)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message, Newtonsoft.Json.JsonSerializerSettings settings) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | | `settings` | `Newtonsoft.Json.JsonSerializerSettings` | The JSON serializer settings to use for deserialization. | #### Returns Type: `System.Threading.Tasks.Task<(T, string)>` A tuple containing either the deserialized response object or error content string. #### Type Parameters * `T` - The type to deserialize the response content to. ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_NewtonsoftJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to strongly-typed response and error objects using Newtonsoft.Json with default settings. Provides type-safe error handling by deserializing error responses to a specific error type. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(TResponse, TError)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | #### Returns Type: `System.Threading.Tasks.Task<(TResponse, TError)>` A tuple containing either the deserialized response object or deserialized error object. #### Type Parameters * `TResponse` - The type to deserialize successful response content to. * `TError` - The type to deserialize error response content to. ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_NewtonsoftJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to strongly-typed response and error objects using Newtonsoft.Json with custom settings. Automatically configures SystemTextJsonContractResolver if not already set. Provides type-safe error handling by deserializing error responses to a specific error type. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(TResponse, TError)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message, Newtonsoft.Json.JsonSerializerSettings settings) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | | `settings` | `Newtonsoft.Json.JsonSerializerSettings` | The JSON serializer settings to use for deserialization. | #### Returns Type: `System.Threading.Tasks.Task<(TResponse, TError)>` A tuple containing either the deserialized response object or deserialized error object. #### Type Parameters * `TResponse` - The type to deserialize successful response content to. * `TError` - The type to deserialize error response content to. ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_SystemTextJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to the specified type using System.Text.Json with default options. Returns either the deserialized response or error content as a string. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(T, string)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | #### Returns Type: `System.Threading.Tasks.Task<(T, string)>` A tuple containing either the deserialized response object or error content string. #### Type Parameters * `T` - The type to deserialize the response content to. ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_SystemTextJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to the specified type using System.Text.Json with custom options. Returns either the deserialized response or error content as a string. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(T, string)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message, System.Text.Json.JsonSerializerOptions settings) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | | `settings` | `System.Text.Json.JsonSerializerOptions` | The JSON serializer options to use for deserialization. | #### Returns Type: `System.Threading.Tasks.Task<(T, string)>` A tuple containing either the deserialized response object or error content string. #### Type Parameters * `T` - The type to deserialize the response content to. ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_SystemTextJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to strongly-typed response and error objects using System.Text.Json with default options. Provides type-safe error handling by deserializing error responses to a specific error type. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(TResponse, TError)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | #### Returns Type: `System.Threading.Tasks.Task<(TResponse, TError)>` A tuple containing either the deserialized response object or deserialized error object. #### Type Parameters * `TResponse` - The type to deserialize successful response content to. * `TError` - The type to deserialize error response content to. ### DeserializeResponseAsync Extension Extension method from `System.Net.Http.EasyAF_Http_SystemTextJson_HttpResponseMessageExtensions` Deserializes the HTTP response message content to strongly-typed response and error objects using System.Text.Json with custom options. Provides type-safe error handling by deserializing error responses to a specific error type. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task<(TResponse, TError)> DeserializeResponseAsync(System.Net.Http.HttpResponseMessage message, System.Text.Json.JsonSerializerOptions settings) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `System.Net.Http.HttpResponseMessage` | The HTTP response message to deserialize. | | `settings` | `System.Text.Json.JsonSerializerOptions` | The JSON serializer options to use for deserialization. | #### Returns Type: `System.Threading.Tasks.Task<(TResponse, TError)>` A tuple containing either the deserialized response object or deserialized error object. #### Type Parameters * `TResponse` - The type to deserialize successful response content to. * `TError` - The type to deserialize error response content to. # Overview Source: https://easyaf.dev/api-reference/System/Net/Http/index Summary of the System.Net.Http Namespace ## Types # Nullable Source: https://easyaf.dev/api-reference/System/Nullable Extension methods for Nullable from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.Nullable ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.nullable\{system.guid}) for more information about the rest of the API. ## Methods ### IsNullOrEmpty Extension Extension method from `System.EasyAF_GuidExtensions` A sweet little extension to check if a Nullable Guid has a real value or not. #### Syntax ```csharp theme={"dark"} public static bool IsNullOrEmpty(System.Nullable instance) ``` #### Parameters | Name | Type | Description | | - | - | - | | `instance` | `System.Nullable` | - | #### Returns Type: `bool` A [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) indicating whether or not the Guid is null or empty. # ClaimsIdentity Source: https://easyaf.dev/api-reference/System/Security/Claims/ClaimsIdentity Extension methods for ClaimsIdentity from System.Security.Claims ## Definition **Assembly:** System.Security.Claims.dll **Namespace:** System.Security.Claims ## Syntax ```csharp theme={"dark"} System.Security.Claims.ClaimsIdentity ``` ## Summary This type is defined in System.Security.Claims. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsidentity) for more information about the rest of the API. ## Methods ### StandardizeClaims Extension Extension method from `System.Security.Claims.EasyAF_ClaimsIdentityExtensions` #### Syntax ```csharp theme={"dark"} public static void StandardizeClaims(System.Security.Claims.ClaimsIdentity identity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `identity` | `System.Security.Claims.ClaimsIdentity` | - | # ClaimsPrincipal Source: https://easyaf.dev/api-reference/System/Security/Claims/ClaimsPrincipal Extension methods for ClaimsPrincipal from System.Security.Claims ## Definition **Assembly:** System.Security.Claims.dll **Namespace:** System.Security.Claims ## Syntax ```csharp theme={"dark"} System.Security.Claims.ClaimsPrincipal ``` ## Summary This type is defined in System.Security.Claims. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal) for more information about the rest of the API. ## Methods ### GetAllClaims Extension Extension method from `System.Security.Claims.EasyAF_ClaimsPrincipalExtensions` #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable GetAllClaims(System.Security.Claims.ClaimsPrincipal claimsPrincipal, string claimType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `claimsPrincipal` | `System.Security.Claims.ClaimsPrincipal` | The ClaimsPrincipal instance to check for Claims. Should be [Current](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.current), except in unit testing. | | `claimType` | `string` | - | #### Returns Type: `System.Collections.Generic.IEnumerable` ### GetClaimGuid Extension Extension method from `System.Security.Claims.EasyAF_ClaimsPrincipalExtensions` #### Syntax ```csharp theme={"dark"} public static System.Guid GetClaimGuid(System.Security.Claims.ClaimsPrincipal claimsPrincipal, string claimType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `claimsPrincipal` | `System.Security.Claims.ClaimsPrincipal` | - | | `claimType` | `string` | - | #### Returns Type: `System.Guid` #### Exceptions | Exception | Description | | - | - | | `FormatException` | If the *claimType* is not formatted like a Guid (32 characters with 4 dashes), this exception will be thrown. | ### GetClaimValue Extension Extension method from `System.Security.Claims.EasyAF_ClaimsPrincipalExtensions` #### Syntax ```csharp theme={"dark"} public static string GetClaimValue(System.Security.Claims.ClaimsPrincipal claimsPrincipal, string claimType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `claimsPrincipal` | `System.Security.Claims.ClaimsPrincipal` | The ClaimsPrincipal instance to check for Claims. Should be [Current](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.current), except in unit testing. | | `claimType` | `string` | - | #### Returns Type: `string` ### GetIdClaim Extension Extension method from `System.Security.Claims.EasyAF_ClaimsPrincipalExtensions` A shortcut for returning the AppUserProfileId for the current User. #### Syntax ```csharp theme={"dark"} public static System.Guid GetIdClaim(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The ClaimsPrincipal instance we're extending. | #### Returns Type: `System.Guid` ### TryGetIdClaim Extension Extension method from `System.Security.Claims.EasyAF_ClaimsPrincipalExtensions` Gets the current User's ID claim as a [Guid](/api-reference/System/Guid), without throwing when the claim is missing or malformed. #### Syntax ```csharp theme={"dark"} public static bool TryGetIdClaim(System.Security.Claims.ClaimsPrincipal principal, out System.Guid id) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The ClaimsPrincipal instance we're extending. | | `id` | `System.Guid` | The ID, or [Empty](https://learn.microsoft.com/dotnet/api/system.guid.empty) when the claim is missing or not a valid [Guid](/api-reference/System/Guid). | #### Returns Type: `bool` [`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the claim exists and is a valid [Guid](/api-reference/System/Guid); otherwise, [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). ### TryGetIdClaim Extension Extension method from `System.Security.Claims.EasyAF_ClaimsPrincipalExtensions` Gets the current User's ID claim as an [Int32](https://learn.microsoft.com/dotnet/api/system.int32), for applications whose user IDs are integers. #### Syntax ```csharp theme={"dark"} public static bool TryGetIdClaim(System.Security.Claims.ClaimsPrincipal principal, out int id) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The ClaimsPrincipal instance we're extending. | | `id` | `int` | The ID, or 0 when the claim is missing or not a valid [Int32](https://learn.microsoft.com/dotnet/api/system.int32). | #### Returns Type: `bool` [`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the claim exists and is a valid [Int32](https://learn.microsoft.com/dotnet/api/system.int32); otherwise, [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). ### TryGetIdClaim Extension Extension method from `System.Security.Claims.EasyAF_ClaimsPrincipalExtensions` Gets the current User's ID claim as a [Int64](https://learn.microsoft.com/dotnet/api/system.int64), for applications whose user IDs are 64-bit integers. #### Syntax ```csharp theme={"dark"} public static bool TryGetIdClaim(System.Security.Claims.ClaimsPrincipal principal, out long id) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The ClaimsPrincipal instance we're extending. | | `id` | `long` | The ID, or 0 when the claim is missing or not a valid [Int64](https://learn.microsoft.com/dotnet/api/system.int64). | #### Returns Type: `bool` [`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the claim exists and is a valid [Int64](https://learn.microsoft.com/dotnet/api/system.int64); otherwise, [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). # EasyAF_ClaimsPrincipalExtensions Source: https://easyaf.dev/api-reference/System/Security/Claims/EasyAF_ClaimsPrincipalExtensions ## Definition **Assembly:** CloudNimble.EasyAF.Core.dll **Namespace:** System.Security.Claims **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} System.Security.Claims.EasyAF_ClaimsPrincipalExtensions ``` ## Properties ### NameClaimType #### Syntax ```csharp theme={"dark"} public static string NameClaimType { get; } ``` #### Property Value Type: `string` ### RoleClaimType #### Syntax ```csharp theme={"dark"} public static string RoleClaimType { get; } ``` #### Property Value Type: `string` ## Methods ### Initialize #### Syntax ```csharp theme={"dark"} public static void Initialize() ``` ### Initialize #### Syntax ```csharp theme={"dark"} public static void Initialize(string schemaUri, string idClaimName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `schemaUri` | `string` | - | | `idClaimName` | `string` | - | ### SetIdClaimName #### Syntax ```csharp theme={"dark"} public static void SetIdClaimName(string idClaimName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `idClaimName` | `string` | - | ### SetSchemaUri Sets the SchemaUrl used [`async`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/async)the basis for all custom claims. #### Syntax ```csharp theme={"dark"} public static void SetSchemaUri(string schemaUri) ``` #### Parameters | Name | Type | Description | | - | - | - | | `schemaUri` | `string` | - | # Overview Source: https://easyaf.dev/api-reference/System/Security/Claims/index Summary of the System.Security.Claims Namespace ## Types ### Classes | Name | Summary | | - | - | | [EasyAF\_ClaimsPrincipalExtensions](/api-reference/System/Security/Claims/EasyAF_ClaimsPrincipalExtensions) | | # JsonSerializerOptions Source: https://easyaf.dev/api-reference/System/Text/Json/JsonSerializerOptions Extension methods for JsonSerializerOptions from System.Text.Json ## Definition **Assembly:** System.Text.Json.dll **Namespace:** System.Text.Json ## Syntax ```csharp theme={"dark"} System.Text.Json.JsonSerializerOptions ``` ## Summary This type is defined in System.Text.Json. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) for more information about the rest of the API. ## Methods ### IgnoreAuditFields Extension Extension method from `System.Text.Json.EasyAF_JsonSerializerOptionsExtensions` Stops [ICreatedAuditable.DateCreated](/api-reference/CloudNimble/EasyAF/Core/ICreatedAuditable#datecreated), `CreatedById`, [IUpdatedAuditable.DateUpdated](/api-reference/CloudNimble/EasyAF/Core/IUpdatedAuditable#dateupdated), and `UpdatedById` from being written when serializing any [DbObservableObject](/api-reference/CloudNimble/EasyAF/Core/DbObservableObject). #### Syntax ```csharp theme={"dark"} public static System.Text.Json.JsonSerializerOptions IgnoreAuditFields(System.Text.Json.JsonSerializerOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `System.Text.Json.JsonSerializerOptions` | The [JsonSerializerOptions](/api-reference/System/Text/Json/JsonSerializerOptions) to configure. Must not have been used for serialization yet. | #### Returns Type: `System.Text.Json.JsonSerializerOptions` The same [JsonSerializerOptions](/api-reference/System/Text/Json/JsonSerializerOptions) instance, so the call can be chained onto an object initializer. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | *options* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | | `InvalidOperationException` | *options* has already been used and is read-only. | #### Examples ```csharp theme={"dark"} var options = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, }.IgnoreAuditFields(); ``` #### Remarks The audit properties are removed from each type's serialization contract the first time that type is serialized, so there is no per-call cost. Every other System.Text.Json setting, including naming policies, [JsonPropertyNameAttribute](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonpropertynameattribute), and [DefaultIgnoreCondition](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions.defaultignorecondition), applies as usual. Audit properties are still read during deserialization. If [TypeInfoResolver](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions.typeinforesolver) is already set (for example, to a source-generated [JsonSerializerContext](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonserializercontext)), the modifier is added to it, so this works with Native AOT. # Overview Source: https://easyaf.dev/api-reference/System/Text/Json/index Summary of the System.Text.Json Namespace ## Types # Uri Source: https://easyaf.dev/api-reference/System/Uri Extension methods for Uri from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.Uri ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.uri) for more information about the rest of the API. ## Methods ### ToODataUri Extension Extension method from `System.EasyAF_Http_UriExtensions` Creates an properly-constructed OData Uri with the correct querystring values, if specified. #### Syntax ```csharp theme={"dark"} public static System.Uri ToODataUri(System.Uri uri, bool dollarSign = true, string filter = null, System.Nullable top = null, System.Nullable skip = null, string orderby = null, string expand = null, string select = null, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `uri` | `System.Uri` | The [Uri](/api-reference/System/Uri) instance to extend. | | `dollarSign` | `bool` | Specifies whether or not the query string name should have a "\$" in it. Defaults to [`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | | `filter` | `string` | The filter. | | `top` | `System.Nullable` | An [Int32](https://learn.microsoft.com/dotnet/api/system.int32) representing the number of records to take. | | `skip` | `System.Nullable` | An [Int32](https://learn.microsoft.com/dotnet/api/system.int32) representing the number of records to skip over. | | `orderby` | `string` | The orderby. | | `expand` | `string` | The expand. | | `select` | `string` | The select. | | `count` | `System.Nullable` | A [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) representing whether to return a count of the total number of records in the response. | #### Returns Type: `System.Uri` A new [Uri](/api-reference/System/Uri) instance with a properly-formatted OData-compatible query string. #### Remarks Inspired by [https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/OData.cs#L235](https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/OData.cs#L235), but performs better. # Overview Source: https://easyaf.dev/api-reference/System/index Summary of the System Namespace ## Types # AppStateBase Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase A base class to control application-wide state in a Blazor app. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** CloudNimble.BlazorEssentials.BlazorObservable ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.AppStateBase ``` ## Summary A base class to control application-wide state in a Blazor app. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public AppStateBase(Microsoft.AspNetCore.Components.NavigationManager navigationManager, System.Net.Http.IHttpClientFactory httpClientFactory, Microsoft.JSInterop.IJSRuntime jsRuntime, Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment environment, CloudNimble.BlazorEssentials.Navigation.NavigationHistory navHistory, CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `navigationManager` | `Microsoft.AspNetCore.Components.NavigationManager` | The Blazor [AppStateBase.NavigationManager](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navigationmanager) instance from the DI container. | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | The [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) instance from the DI container. | | `jsRuntime` | `Microsoft.JSInterop.IJSRuntime` | The [IJSRuntime](https://learn.microsoft.com/dotnet/api/microsoft.jsinterop.ijsruntime) instance from the DI container. | | `environment` | `Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment` | The [IWebAssemblyHostEnvironment](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.webassembly.hosting.iwebassemblyhostenvironment) instance from the DI container. | | `navHistory` | `CloudNimble.BlazorEssentials.Navigation.NavigationHistory` | The [AppStateBase.NavigationHistory](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navigationhistory) instance from the DI container. | | `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | The [StateHasChangedConfig](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig) instance from the DI container. | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Creates a new instance of the [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) class. #### Syntax ```csharp theme={"dark"} public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - | ## Properties ### AuthenticationStateProvider The [AppStateBase.AuthenticationStateProvider](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#authenticationstateprovider) instance for the application. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider AuthenticationStateProvider { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider` #### Remarks This property correctly registers for and de-registers from [AppStateBase.AuthenticationStateProvider](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#authenticationstateprovider) events as the value is set, and automatically calls [AppStateBase.RefreshClaimsPrincipal](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#refreshclaimsprincipal) for you. ### ClaimsPrincipal The [AppStateBase.ClaimsPrincipal](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#claimsprincipal) returned from calling [User](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.authorization.authenticationstate.user). #### Syntax ```csharp theme={"dark"} public System.Security.Claims.ClaimsPrincipal ClaimsPrincipal { get; set; } ``` #### Property Value Type: `System.Security.Claims.ClaimsPrincipal` ### CurrentNavItem The [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) from [AppStateBase.NavItems](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navitems) that corresponds to the current Route. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Navigation.NavigationItem CurrentNavItem { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Navigation.NavigationItem` ### Environment The [WebAssemblyHostEnvironment](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.webassembly.hosting.webassemblyhostenvironment) injected from the DI container. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment Environment { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment` ### HttpClientFactory The instance of the [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) injected by the DI system. #### Syntax ```csharp theme={"dark"} public System.Net.Http.IHttpClientFactory HttpClientFactory { get; private set; } ``` #### Property Value Type: `System.Net.Http.IHttpClientFactory` ### IsClaimsPrincipalAuthenticated Returns a value indicating whether or not the current [AppStateBase.ClaimsPrincipal](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#claimsprincipal)ClaimsPrincipal's\ Identity is authenticated. #### Syntax ```csharp theme={"dark"} public bool IsClaimsPrincipalAuthenticated { get; } ``` #### Property Value Type: `bool` ### JSRuntime #### Syntax ```csharp theme={"dark"} public Microsoft.JSInterop.IJSRuntime JSRuntime { get; set; } ``` #### Property Value Type: `Microsoft.JSInterop.IJSRuntime` ### LoadingStatus Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` A [BlazorObservable.LoadingStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable#loadingstatus) specifying the current state of the required data for this Observable. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.LoadingStatus` ### NavigationHistory Allows the application to interact with the browser's History API. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Navigation.NavigationHistory NavigationHistory { get; private set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Navigation.NavigationHistory` #### Remarks This really should be a part of the NavigationManager, but what do we know? ¯\_(ツ)\_/¯ ### NavigationManager The instance of the [AppStateBase.NavigationManager](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navigationmanager) injected by the DI system. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.NavigationManager NavigationManager { get; private set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.NavigationManager` ### NavItems An [ObservableCollection\`1](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1) containing the primary navigation details for the application. #### Syntax ```csharp theme={"dark"} public System.Collections.ObjectModel.ObservableCollection NavItems { get; internal set; } ``` #### Property Value Type: `System.Collections.ObjectModel.ObservableCollection` ### StateHasChanged Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Determines how to trigger StateHasChanged events in a Blazor component. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig` ## Methods ### Dispose Override Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` #### Syntax ```csharp theme={"dark"} protected override void Dispose(bool disposing) ``` #### Parameters | Name | Type | Description | | - | - | - | | `disposing` | `bool` | - | ### LoadNavItems Load the NavigationItems into [AppStateBase.NavItems](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navitems) and properly wire up the PropertyChanged event. #### Syntax ```csharp theme={"dark"} public void LoadNavItems(System.Collections.Generic.List items) ``` #### Parameters | Name | Type | Description | | - | - | - | | `items` | `System.Collections.Generic.List` | - | ### Navigate Navigates to the specified Uri and sets [AppStateBase.CurrentNavItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#currentnavitem) to the matching [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) in [AppStateBase.NavItems](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navitems). #### Syntax ```csharp theme={"dark"} public void Navigate(string uri, bool setCurrentNavItem = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `uri` | `string` | - | | `setCurrentNavItem` | `bool` | Determines whether or not we should also set the CurrentNavItem. Usually this is no because the MainLayout should call | | AppState.SetCurrentNavItem in OnParametersSet. This parameter gives you flexibility without potentially calling it twice. | | | ### NavigateBackAsync Utilizes the injected [AppStateBase.NavigationHistory](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navigationhistory) History API to navigate to the last entry in the history stack, and attempts to set the [AppStateBase.CurrentNavItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#currentnavitem). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task NavigateBackAsync(bool setCurrentNavItem = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `setCurrentNavItem` | `bool` | Determines whether or not we should also set the CurrentNavItem. Usually this is no because the MainLayout should call | | AppState.SetCurrentNavItem in OnParametersSet. This parameter gives you flexibility without potentially calling it twice. | | | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) representing the completion state of the operation. #### Remarks Will not throw an exception if you are at the bottom of the History stack. ### NavigateForwardAsync Utilizes the injected [AppStateBase.NavigationHistory](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#navigationhistory) History API to navigate to the next entry in the history stack, and attempts to set the [AppStateBase.CurrentNavItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#currentnavitem). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task NavigateForwardAsync(bool setCurrentNavItem = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `setCurrentNavItem` | `bool` | Determines whether or not we should also set the CurrentNavItem. Usually this is no because the MainLayout should call | | AppState.SetCurrentNavItem in OnParametersSet. This parameter gives you flexibility without potentially calling it twice. | | | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) representing the completion state of the operation. #### Remarks Will not throw an exception if you are at the top of the History stack. ### OpenInNewTab #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OpenInNewTab(string url) ``` #### Parameters | Name | Type | Description | | - | - | - | | `url` | `string` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks [https://stackoverflow.com/a/62769092](https://stackoverflow.com/a/62769092) ### RefreshClaimsPrincipal Tells the AuthenticationProvider to get the latest ClaimsPrincipal and run it through the internal AuthenticationStateChanged handler. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task RefreshClaimsPrincipal() ``` #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) representing the completion state of the operation. ### SetCurrentNavItem Initializes [AppStateBase.CurrentNavItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#currentnavitem) to the proper value based on the current route. #### Syntax ```csharp theme={"dark"} public void SetCurrentNavItem() ``` ### SetCurrentNavItem Initializes [AppStateBase.CurrentNavItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#currentnavitem) to the proper value based on the current route. #### Syntax ```csharp theme={"dark"} public void SetCurrentNavItem(string url) ``` #### Parameters | Name | Type | Description | | - | - | - | | `url` | `string` | - | # BlazorEssentialsAuthorizationMessageHandler Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Authentication/BlazorEssentialsAuthorizationMessageHandler ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Authentication **Inheritance:** Microsoft.AspNetCore.Components.WebAssembly.Authentication.AuthorizationMessageHandler ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Authentication.BlazorEssentialsAuthorizationMessageHandler ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BlazorEssentialsAuthorizationMessageHandler(T config, Microsoft.AspNetCore.Components.WebAssembly.Authentication.IAccessTokenProvider provider, Microsoft.AspNetCore.Components.NavigationManager navigationManager) ``` #### Parameters | Name | Type | Description | | - | - | - | | `config` | `T` | - | | `provider` | `Microsoft.AspNetCore.Components.WebAssembly.Authentication.IAccessTokenProvider` | - | | `navigationManager` | `Microsoft.AspNetCore.Components.NavigationManager` | - | # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Authentication/index Summary of the CloudNimble.BlazorEssentials.Authentication Namespace ## Types ### Classes | Name | Summary | | - | - | | [BlazorEssentialsAuthorizationMessageHandler](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Authentication/BlazorEssentialsAuthorizationMessageHandler) | | # BlazorObservable Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable A base class for Blazor ViewModels to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged)... ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** CloudNimble.EasyAF.Core.EasyObservableObject ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.BlazorObservable ``` ## Summary A base class for Blazor ViewModels to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged) and [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable). ## Constructors ### .ctor Creates a new instance of the [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) class. #### Syntax ```csharp theme={"dark"} public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - | ## Properties ### LoadingStatus A [BlazorObservable.LoadingStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable#loadingstatus) specifying the current state of the required data for this Observable. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.LoadingStatus` ### StateHasChanged Determines how to trigger StateHasChanged events in a Blazor component. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig` # BlazorEssentialsTestBase Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/BlazorEssentialsTestBase ## Definition **Assembly:** CloudNimble.BlazorEssentials.Breakdance.dll **Namespace:** CloudNimble.BlazorEssentials.Breakdance **Inheritance:** CloudNimble.Breakdance.Blazor.BlazorBreakdanceTestBase ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Breakdance.BlazorEssentialsTestBase ``` ## Type Parameters * `TConfiguration` - * `TAppState` - ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BlazorEssentialsTestBase() ``` ## Methods ### AssemblySetup Override DO NOT USE THIS METHOD. Throws a [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) when called. You must call `String)` or `TestSetup` instead. #### Syntax ```csharp theme={"dark"} public override void AssemblySetup() ``` #### Exceptions | Exception | Description | | - | - | | `NotSupportedException` | Throws a NotSupportedException when called. | ### ClassSetup #### Syntax ```csharp theme={"dark"} public void ClassSetup(string configSectionName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `configSectionName` | `string` | - | ### ClassSetup #### Syntax ```csharp theme={"dark"} public void ClassSetup(string configSectionName, string environment = "Development", string baseAddress = "https://localhost") where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `configSectionName` | `string` | - | | `environment` | `string` | - | | `baseAddress` | `string` | - | #### Type Parameters * `TMessageHandler` - ### ClassSetup #### Syntax ```csharp theme={"dark"} public void ClassSetup(string configSectionName, CloudNimble.EasyAF.Core.HttpHandlerMode httpHandlerMode, string environment = "Development", string baseAddress = "https://localhost") where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `configSectionName` | `string` | - | | `httpHandlerMode` | `CloudNimble.EasyAF.Core.HttpHandlerMode` | - | | `environment` | `string` | - | | `baseAddress` | `string` | - | #### Type Parameters * `TMessageHandler` - ### TestSetup Configures the BlazorEssentials services into the BUnitTestContext IServiceProvider for the currently-executing test only. #### Syntax ```csharp theme={"dark"} public void TestSetup(string configSectionName, string environment = "Development", string baseAddress = "https://localhost") ``` #### Parameters | Name | Type | Description | | - | - | - | | `configSectionName` | `string` | - | | `environment` | `string` | - | | `baseAddress` | `string` | - | #### Remarks RWM: These methods exist because bUnit is configured per-test, and the BlazorEssentials configuration can change on a per-test basis. bUnit will resolve from its own container first, then fall back to the TestHost's ServiceProvider if not found. This methods puts a new configuration in place instead, to be used only for the currently-executing test. ### TestSetup Configures the BlazorEssentials services into the BUnitTestContext IServiceProvider for the currently-executing test only. #### Syntax ```csharp theme={"dark"} public void TestSetup(string configSectionName, CloudNimble.EasyAF.Core.HttpHandlerMode httpHandlerMode = 2, string environment = "Development", string baseAddress = "https://localhost") where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `configSectionName` | `string` | - | | `httpHandlerMode` | `CloudNimble.EasyAF.Core.HttpHandlerMode` | - | | `environment` | `string` | - | | `baseAddress` | `string` | - | #### Type Parameters * `TMessageHandler` - #### Remarks RWM: These methods exist because bUnit is configured per-test, and the BlazorEssentials configuration can change on a per-test basis. bUnit will resolve from its own container first, then fall back to the TestHost's ServiceProvider if not found. This methods puts a new configuration in place instead, to be used only for the currently-executing test. ### TestSetup Override DO NOT USE THIS METHOD. Throws a [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) when called. You must call `String)` or `TestSetup` instead. #### Syntax ```csharp theme={"dark"} public override void TestSetup() ``` #### Exceptions | Exception | Description | | - | - | | `NotSupportedException` | Throws a NotSupportedException when called. | # TestableAuthenticationStateProvider Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/TestableAuthenticationStateProvider ## Definition **Assembly:** CloudNimble.BlazorEssentials.Breakdance.dll **Namespace:** CloudNimble.BlazorEssentials.Breakdance **Inheritance:** Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Breakdance.TestableAuthenticationStateProvider ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TestableAuthenticationStateProvider() ``` ## Methods ### GetAuthenticationStateAsync Override #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task GetAuthenticationStateAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` # TestableWebAssemblyHostEnvironment Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/TestableWebAssemblyHostEnvironment ## Definition **Assembly:** CloudNimble.BlazorEssentials.Breakdance.dll **Namespace:** CloudNimble.BlazorEssentials.Breakdance **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Breakdance.TestableWebAssemblyHostEnvironment ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TestableWebAssemblyHostEnvironment() ``` ### .ctor #### Syntax ```csharp theme={"dark"} public TestableWebAssemblyHostEnvironment(string environment) ``` #### Parameters | Name | Type | Description | | - | - | - | | `environment` | `string` | - | ### .ctor #### Syntax ```csharp theme={"dark"} public TestableWebAssemblyHostEnvironment(string environment, string baseAddress) ``` #### Parameters | Name | Type | Description | | - | - | - | | `environment` | `string` | - | | `baseAddress` | `string` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BaseAddress #### Syntax ```csharp theme={"dark"} public string BaseAddress { get; internal set; } ``` #### Property Value Type: `string` ### Environment #### Syntax ```csharp theme={"dark"} public string Environment { get; internal set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment # ViewModelTestHelpers Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/ViewModelTestHelpers ## Definition **Assembly:** CloudNimble.BlazorEssentials.Breakdance.dll **Namespace:** CloudNimble.BlazorEssentials.Breakdance **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Breakdance.ViewModelTestHelpers ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ViewModelTestHelpers() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/index Summary of the CloudNimble.BlazorEssentials.Breakdance Namespace ## Types ### Classes | Name | Summary | | - | - | | [BlazorEssentialsTestBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/BlazorEssentialsTestBase) | | | [TestableAuthenticationStateProvider](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/TestableAuthenticationStateProvider) | | | [TestableWebAssemblyHostEnvironment](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/TestableWebAssemblyHostEnvironment) | | | [ViewModelTestHelpers](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Breakdance/ViewModelTestHelpers) | | # LoadingContainer Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Controls/LoadingContainer ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Controls **Inheritance:** Microsoft.AspNetCore.Components.ComponentBase ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Controls.LoadingContainer ``` ## Type Parameters * `TItem` - ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public LoadingContainer() ``` ## Properties ### Data The information you will be binding this control against. You should typically use the two-way binding syntax of '@bind-Data' to connect this information to the control. #### Syntax ```csharp theme={"dark"} public TItem Data { get; set; } ``` #### Property Value Type: `TItem` ### DataChanged The event handler used to update the Parent control about `Data` changes during two-way binding. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.EventCallback DataChanged { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.EventCallback` ### FailedContent The content to display when the `LoadingStatus` list set to [LoadingStatus.Failed](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus#failed). #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment FailedContent { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### LoadedContent The content to display when the `LoadingStatus` list set to [LoadingStatus.Loaded](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus#loaded). #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment LoadedContent { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### LoadingContent The content to display when the `LoadingStatus` list set to [LoadingStatus.Loading](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus#loading). #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment LoadingContent { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### LoadingStatus The particular property containing the LoadingStatus that you want to track.. You should typically use the two-way binding syntax of '@bind-Data' to connect this information to the control. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.LoadingStatus` ### LoadingStatusChanged The event handler used to update the Parent control about `LoadingStatus` changes during two-way binding. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.EventCallback LoadingStatusChanged { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.EventCallback` ### NoResultsContent The content to display when the `LoadingStatus` list set to [LoadingStatus.Loaded](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus#loaded) and `Data` list either null, or is a list that contains no objects. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment NoResultsContent { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### NotLoadedContent The content to display when the `LoadingStatus` list set to [LoadingStatus.NotLoaded](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus#notloaded). This is typically the initial state for a ViewModel. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment NotLoadedContent { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Controls/index Summary of the CloudNimble.BlazorEssentials.Controls Namespace ## Types ### Classes | Name | Summary | | - | - | | [LoadingContainer](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Controls/LoadingContainer) | | # Html Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Html A port of the ASP.NET MVC HtmlHelper class to Blazor. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Html ``` ## Summary A port of the ASP.NET MVC HtmlHelper class to Blazor. ## Remarks [https://github.com/aspnet/AspNetWebStack/blob/main/src/System.Web.Mvc/HtmlHelper.cs](https://github.com/aspnet/AspNetWebStack/blob/main/src/System.Web.Mvc/HtmlHelper.cs) & [https://github.com/dotnet/aspnetcore/tree/main/src/Mvc/Mvc.ViewFeatures/src/Rendering](https://github.com/dotnet/aspnetcore/tree/main/src/Mvc/Mvc.ViewFeatures/src/Rendering) ## Methods ### Raw Outputs HTML to the browser without encoding it. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Components.MarkupString Raw(string content) ``` #### Parameters | Name | Type | Description | | - | - | - | | `content` | `string` | - | #### Returns Type: `Microsoft.AspNetCore.Components.MarkupString` A [MarkupString](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.markupstring) containing the pre-encoded HTML. # IndexAttribute Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexAttribute ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.IndexAttribute ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexAttribute() ``` ## Properties ### Name #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### Path #### Syntax ```csharp theme={"dark"} public string Path { get; set; } ``` #### Property Value Type: `string` # IndexedDbDatabase Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbDatabase Provides functionality for accessing IndexedDB from Blazor application ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase ``` ## Summary Provides functionality for accessing IndexedDB from Blazor application ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbDatabase(Microsoft.JSInterop.IJSRuntime jsRuntime) ``` #### Parameters | Name | Type | Description | | - | - | - | | `jsRuntime` | `Microsoft.JSInterop.IJSRuntime` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DatabaseDefinition #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbDatabaseDefinition DatabaseDefinition { get; internal set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbDatabaseDefinition` ### Name #### Syntax ```csharp theme={"dark"} public string Name { get; init; } ``` #### Property Value Type: `string` ### ObjectStores #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ObjectStores { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Version #### Syntax ```csharp theme={"dark"} public int Version { get; set; } ``` #### Property Value Type: `int` ## Methods ### CallJavaScriptAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CallJavaScriptAsync(string functionName, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `functionName` | `string` | - | | `args` | `object[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Exceptions | Exception | Description | | - | - | | `IndexedDbException` | | ### CallJavaScriptAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CallJavaScriptAsync(string functionName, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `functionName` | `string` | - | | `args` | `object?[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TResult` - #### Exceptions | Exception | Description | | - | - | | `IndexedDbException` | | ### ConsoleLog #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ConsoleLog(params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `args` | `object[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Exceptions | Exception | Description | | - | - | | `IndexedDbException` | | ### CreateObjectStoreAsync This function provides the means to add a store to an existing database, #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CreateObjectStoreAsync(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore objectStore) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objectStore` | `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore` | - | #### Returns Type: `System.Threading.Tasks.Task` ### DeleteDatabaseAsync Deletes this IndexedDb instance from the browser. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteDatabaseAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### EnsureIsOpenAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task EnsureIsOpenAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### LoadSchemaAsync Load database schema from databaseName #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task LoadSchemaAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OpenAsync Opens the IndexedDB defined in the DbDatabase. Under the covers will create the database if it does not exist and create the stores defined in DbDatabase. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OpenAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IndexedDbException Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbException ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.IndexedDbException ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | - | # IndexedDbIndex Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbIndex Defines an Index for a given object store. ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.IndexedDbIndex ``` ## Summary Defines an Index for a given object store. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbIndex(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore objectStore, string name, string keyPath, bool multiEntry = false, bool unique = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objectStore` | `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore` | - | | `name` | `string` | - | | `keyPath` | `string` | - | | `multiEntry` | `bool` | - | | `unique` | `bool` | - | #### Exceptions | Exception | Description | | - | - | | `IndexedDbException` | | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Database #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase Database { get; init; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase` ### KeyPath the identifier for the property in the object/record that is saved and is to be indexed. can be multiple properties separated by comma if null will default to index name #### Syntax ```csharp theme={"dark"} public string KeyPath { get; } ``` #### Property Value Type: `string` ### MultiEntry Affects how the index behaves when the result of evaluating the index's key path yields an array. If true, there is one record in the index for each item in an array of keys. If false, then there is one record for each key that is an array. #### Syntax ```csharp theme={"dark"} public bool MultiEntry { get; } ``` #### Property Value Type: `bool` ### Name The name of the index. #### Syntax ```csharp theme={"dark"} public string Name { get; } ``` #### Property Value Type: `string` ### ObjectStore Only use for indexes If true, this index does not allow duplicate values for a key. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore ObjectStore { get; init; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore` ### Unique Only use for indexes If true, this index does not allow duplicate values for a key. #### Syntax ```csharp theme={"dark"} public bool Unique { get; } ``` #### Property Value Type: `bool` ## Methods ### CountAsync Count records in Index #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### CountAsync Count records in Index #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync(TKey key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - ### CountAsync Count records in Index #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync(CloudNimble.BlazorEssentials.IndexedDb.KeyRange key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAllAsync Gets all of the records that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TResult` - ### GetAllAsync Gets all of the records that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(TKey key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllAsync Gets all of the records that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(CloudNimble.BlazorEssentials.IndexedDb.KeyRange key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllAsync Gets all of the records that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(TKey[] key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey[]` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllKeysAsync Gets all of the records keys that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TResult` - ### GetAllKeysAsync Gets all of the records keys that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(TKey key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllKeysAsync Gets all of the records that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(CloudNimble.BlazorEssentials.IndexedDb.KeyRange key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllKeysAsync Gets all of the records that match a given query in the specified index. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(TKey[] key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey[]` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAsync Returns the first record that matches a query against a given index #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GetAsync(TKey queryValue) ``` #### Parameters | Name | Type | Description | | - | - | - | | `queryValue` | `TKey` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - * `TResult` - ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetKeyAsync Returns the first record keys that matches a query against a given index #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GetKeyAsync(TKey key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - * `TResult` - ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### QueryAsync Gets all of the records using a filter expression #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string filter, System.Nullable count = null, System.Nullable skip = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filter` | `string` | expression that evaluates to true/false, each record es passed to "obj" parameter | | `count` | `System.Nullable` | - | | `skip` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TResult` - ### QueryAsync Gets all of the records using a filter expression #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string filter, TKey key, System.Nullable count = null, System.Nullable skip = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filter` | `string` | expression that evaluates to true/false, each record es passed to "obj" parameter | | `key` | `TKey` | - | | `count` | `System.Nullable` | - | | `skip` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### QueryAsync Gets all of the records using a filter expression #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string filter, CloudNimble.BlazorEssentials.IndexedDb.KeyRange key, System.Nullable count = null, System.Nullable skip = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filter` | `string` | expression that evaluates to true/false, each record es passed to "obj" parameter | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | | `count` | `System.Nullable` | - | | `skip` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IndexedDbNotFoundException Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbNotFoundException ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** CloudNimble.BlazorEssentials.IndexedDb.IndexedDbException ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.IndexedDbNotFoundException ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbNotFoundException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbException` #### Syntax ```csharp theme={"dark"} public IndexedDbException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | - | # IndexedDbObjectStore Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbObjectStore Defines a store to add to database ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore ``` ## Summary Defines a store to add to database ## Constructors ### .ctor Add new ObjectStore definition #### Syntax ```csharp theme={"dark"} public IndexedDbObjectStore(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase database, CloudNimble.BlazorEssentials.IndexedDb.ObjectStoreAttribute attribute = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `database` | `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase` | - | | `attribute` | `CloudNimble.BlazorEssentials.IndexedDb.ObjectStoreAttribute` | - | ### .ctor Add new ObjectStore definition #### Syntax ```csharp theme={"dark"} public IndexedDbObjectStore(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase database, string name, string keyPath = "id", bool autoIncrement = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `database` | `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase` | - | | `name` | `string` | - | | `keyPath` | `string` | - | | `autoIncrement` | `bool` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AutoIncrement If true, the object store has a key generator. Defaults to false. Note that every object store has its own separate auto increment counter. #### Syntax ```csharp theme={"dark"} public bool AutoIncrement { get; init; } ``` #### Property Value Type: `bool` ### Database IDMManager #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase Database { get; init; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase` ### Indexes Provides a set of additional indexes if required. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Indexes { get; init; } ``` #### Property Value Type: `System.Collections.Generic.List` ### KeyPath the identifier for the property in the object/record that is saved and is to be indexed. can be multiple properties separated by comma If this property is null, the application must provide a key for each modification operation. #### Syntax ```csharp theme={"dark"} public string KeyPath { get; init; } ``` #### Property Value Type: `string?` ### Name The name for the store #### Syntax ```csharp theme={"dark"} public string Name { get; internal set; } ``` #### Property Value Type: `string` ## Methods ### AddAsync Adds a new record/object to the specified ObjectStore #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AddAsync(TData data) where TData : notnull ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - ### AddAsync Adds a new record/object to the specified ObjectStore #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AddAsync(TData data) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - * `TKey` - ### AddAsync Adds a new record/object to the specified ObjectStore #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AddAsync(TData data, TKey key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData` | - | | `key` | `TKey` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - * `TKey` - ### BatchAddAsync Add an array of new record/object in one transaction to the specified store #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task BatchAddAsync(TData[] data) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - ### BatchAddAsync Add an array of new record/object in one transaction to the specified store #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task BatchAddAsync(TData[] data) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - * `TKey` - ### BatchDeleteAsync Delete multiple records from the store based on the id #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task BatchDeleteAsync(TKey[] ids) ``` #### Parameters | Name | Type | Description | | - | - | - | | `ids` | `TKey[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - ### BatchPutAsync Put an array of new record/object in one transaction to the specified store #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task BatchPutAsync(TData[] data) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - ### BatchPutAsync Put an array of new record/object in one transaction to the specified store #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task BatchPutAsync(TData[] data) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData[]` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - * `TKey` - ### ClearStoreAsync Clears all of the records from a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ClearStoreAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### CountAsync Count records in ObjectStore #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### CountAsync Count records in ObjectStore #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync(TKey key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - ### CountAsync Count records in ObjectStore #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync(CloudNimble.BlazorEssentials.IndexedDb.KeyRange key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - ### DeleteAsync Deletes a record from the store based on the id #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteAsync(TKey key) where TKey : notnull ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAllAsync Gets all of the records in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TResult` - ### GetAllAsync Gets all of the records by Key in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(TKey key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllAsync Gets all of the records by KeyRange in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(CloudNimble.BlazorEssentials.IndexedDb.KeyRange key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllAsync Gets all of the records by ArrayKey in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllAsync(TKey[] key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey[]` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllKeysAsync Gets all of the records keys in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TResult` - ### GetAllKeysAsync Gets all of the records keys by Key in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(TKey key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllKeysAsync Gets all of the records by KeyRange in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(CloudNimble.BlazorEssentials.IndexedDb.KeyRange key, System.Nullable count = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | | `count` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAllKeysAsync Gets all of the records by ArrayKey in a given store. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GetAllKeysAsync(TKey[] key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey[]` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### GetAsync Retrieve a record by Key #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GetAsync(TKey key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | the key of the record | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - * `TResult` - ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetKeyAsync Retrieve a record key by Key #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GetKeyAsync(TKey key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `TKey` | the key of the record | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TKey` - * `TResult` - ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PutAsync Updates and existing record #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task PutAsync(TData data) where TData : notnull ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - ### PutAsync Updates and existing record #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task PutAsync(TData data) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - * `TKey` - ### PutAsync Updates and existing record #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task PutAsync(TData data, TKey key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `TData` | - | | `key` | `TKey` | - | #### Returns Type: `System.Threading.Tasks.Task` #### Type Parameters * `TData` - * `TKey` - ### QueryAsync Gets all of the records using a filter expression #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string filter, System.Nullable count = null, System.Nullable skip = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filter` | `string` | expression that evaluates to true/false, each record es passed to "obj" parameter | | `count` | `System.Nullable` | - | | `skip` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TResult` - ### QueryAsync Gets all of the records using a filter expression #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string name, string filter, TKey key, System.Nullable count = null, System.Nullable skip = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | - | | `filter` | `string` | expression that evaluates to true/false, each record es passed to "obj" parameter | | `key` | `TKey` | - | | `count` | `System.Nullable` | - | | `skip` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### QueryAsync Gets all of the records using a filter expression #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string filter, CloudNimble.BlazorEssentials.IndexedDb.KeyRange key, System.Nullable count = null, System.Nullable skip = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filter` | `string` | expression that evaluates to true/false, each record es passed to "obj" parameter | | `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange` | - | | `count` | `System.Nullable` | - | | `skip` | `System.Nullable` | - | #### Returns Type: `System.Threading.Tasks.Task>` #### Type Parameters * `TKey` - * `TResult` - ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # KeyRange Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/KeyRange ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.KeyRange ``` ## Type Parameters * `TKey` - ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public KeyRange() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Lower #### Syntax ```csharp theme={"dark"} public TKey Lower { get; set; } ``` #### Property Value Type: `TKey?` ### LowerOpen #### Syntax ```csharp theme={"dark"} public bool LowerOpen { get; set; } ``` #### Property Value Type: `bool` ### Upper #### Syntax ```csharp theme={"dark"} public TKey Upper { get; set; } ``` #### Property Value Type: `TKey?` ### UpperOpen #### Syntax ```csharp theme={"dark"} public bool UpperOpen { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ObjectStoreAttribute Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/ObjectStoreAttribute Helps define the structure of a [IndexedDbObjectStore](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbObjectStore) so you don't have to subcl... ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.ObjectStoreAttribute ``` ## Summary Helps define the structure of a [IndexedDbObjectStore](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbObjectStore) so you don't have to subclass one for every object store. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ObjectStoreAttribute() ``` ## Properties ### AutoIncrementKeys Specifies if the keys for this [IndexedDbObjectStore](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbObjectStore) should auto-increment. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool AutoIncrementKeys { get; set; } ``` #### Property Value Type: `bool` ### KeyPath Specifies the name of the Key for this [IndexedDbObjectStore](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbObjectStore). Defaults to "id". #### Syntax ```csharp theme={"dark"} public string KeyPath { get; set; } ``` #### Property Value Type: `string` ### Name Specifies the name of the Object Store. Defaults to the the name of the property in the [IndexedDbDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbDatabase). #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` # IndexedDbDatabaseDefinition Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/Schema/IndexedDbDatabaseDefinition ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb.Schema **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbDatabaseDefinition ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbDatabaseDefinition() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Name #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### ObjectStores #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ObjectStores { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Version #### Syntax ```csharp theme={"dark"} public int Version { get; set; } ``` #### Property Value Type: `int` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetDatabaseDefinition #### Syntax ```csharp theme={"dark"} public static CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbDatabaseDefinition GetDatabaseDefinition(string name, int version, System.Collections.Generic.List objectStores) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | - | | `version` | `int` | - | | `objectStores` | `System.Collections.Generic.List` | - | #### Returns Type: `CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbDatabaseDefinition` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IndexedDbIndexDefinition Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/Schema/IndexedDbIndexDefinition ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb.Schema **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbIndexDefinition ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbIndexDefinition() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### KeyPath #### Syntax ```csharp theme={"dark"} public string KeyPath { get; set; } ``` #### Property Value Type: `string?` ### MultiEntry #### Syntax ```csharp theme={"dark"} public bool MultiEntry { get; set; } ``` #### Property Value Type: `bool` ### Name #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### Unique #### Syntax ```csharp theme={"dark"} public bool Unique { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IndexedDbObjectStoreDefinition Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/Schema/IndexedDbObjectStoreDefinition ## Definition **Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll **Namespace:** CloudNimble.BlazorEssentials.IndexedDb.Schema **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbObjectStoreDefinition ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbObjectStoreDefinition() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AutoIncrement #### Syntax ```csharp theme={"dark"} public bool AutoIncrement { get; set; } ``` #### Property Value Type: `bool` ### Indexes #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Indexes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### KeyPath #### Syntax ```csharp theme={"dark"} public string KeyPath { get; set; } ``` #### Property Value Type: `string?` ### Name #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/Schema/index Summary of the CloudNimble.BlazorEssentials.IndexedDb.Schema Namespace ## Types ### Classes | Name | Summary | | - | - | | [IndexedDbDatabaseDefinition](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/Schema/IndexedDbDatabaseDefinition) | | | [IndexedDbIndexDefinition](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/Schema/IndexedDbIndexDefinition) | | | [IndexedDbObjectStoreDefinition](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/Schema/IndexedDbObjectStoreDefinition) | | # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/index Summary of the CloudNimble.BlazorEssentials.IndexedDb Namespace ## Types ### Classes | Name | Summary | | - | - | | [IndexAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexAttribute) | | | [ObjectStoreAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/ObjectStoreAttribute) | Helps define the structure of a [IndexedDbObjectStore](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbObjectStore) so you don't have to subclass one for every object store. | | [IndexedDbException](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbException) | | | [IndexedDbNotFoundException](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbNotFoundException) | | | [IndexedDbDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbDatabase) | Provides functionality for accessing IndexedDB from Blazor application | | [IndexedDbIndex](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbIndex) | Defines an Index for a given object store. | | [IndexedDbObjectStore](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/IndexedDbObjectStore) | Defines a store to add to database | | [KeyRange](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/IndexedDb/KeyRange) | | # InterfaceElement Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement Represents the basic parts of any HTML element. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.InterfaceElement ``` ## Summary Represents the basic parts of any HTML element. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public InterfaceElement() ``` ### .ctor #### Syntax ```csharp theme={"dark"} public InterfaceElement(string displayText, string iconClass, string cssClass = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `displayText` | `string` | - | | `iconClass` | `string` | - | | `cssClass` | `string` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CssClass A string representing the CSS classes that will be applied to the element. #### Syntax ```csharp theme={"dark"} public string CssClass { get; set; } ``` #### Property Value Type: `string` ### DisplayText A string representing the text that will be displayed inside the element. #### Syntax ```csharp theme={"dark"} public string DisplayText { get; set; } ``` #### Property Value Type: `string` ### IconClass A string representing the CSS class for the icon that will be rendered immediately before the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). #### Syntax ```csharp theme={"dark"} public string IconClass { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # JsModule Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/JsModule A wrapper that makes it easier to dynamically import JavaScript modules in Blazor. Can be used as the foundation to build strongly-typed .NET wr... ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.JsModule ``` ## Summary A wrapper that makes it easier to dynamically import JavaScript modules in Blazor. Can be used as the foundation to build strongly-typed .NET wrappers around JavaScript libraries. ## Remarks I built this because trying to remember the same pattern for importing JS modules in Blazor was driving me nuts. ## Constructors ### .ctor Creates a new instance of the [JsModule](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/JsModule) class. #### Syntax ```csharp theme={"dark"} public JsModule(Microsoft.JSInterop.IJSRuntime jsRuntime, string modulePath = "") ``` #### Parameters | Name | Type | Description | | - | - | - | | `jsRuntime` | `Microsoft.JSInterop.IJSRuntime` | The [IJSRuntime](https://learn.microsoft.com/dotnet/api/microsoft.jsinterop.ijsruntime) instance that was likely injected by the ViewModel / Page / Control this module is | | being used in. | | | | `modulePath` | `string` | The full path to the JS file to wrap. Should usually be in the format "../content//.js". | #### Remarks If you don't provide a *modulePath*, the constructor will attempt to infer it from the calling assembly, in the format "../\_content//.js". ### .ctor Creates a new instance of the [JsModule](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/JsModule) class. #### Syntax ```csharp theme={"dark"} public JsModule(Microsoft.JSInterop.IJSRuntime jsRuntime, string packageName, string modulePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `jsRuntime` | `Microsoft.JSInterop.IJSRuntime` | The [IJSRuntime](https://learn.microsoft.com/dotnet/api/microsoft.jsinterop.ijsruntime) instance that was likely injected by the ViewModel / Page / Control this module is | | being used in. | | | | `packageName` | `string` | - | | `modulePath` | `string` | The path to the file, usually from the 'wwwroot' folder in the base of the project. | #### Remarks The SDK-style project system actually does a really good job of knowing when the PackageId is different from the AssemblyName, so this constructor may not be necessary. ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Instance Returns a [Lazy`1](https://learn.microsoft.com/dotnet/api/system.lazy-1) reference to the [Task`1](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) of importing the module through [IJSRuntime](https://learn.microsoft.com/dotnet/api/microsoft.jsinterop.ijsruntime). #### Syntax ```csharp theme={"dark"} public System.Lazy> Instance { get; private set; } ``` #### Property Value Type: `System.Lazy>` #### Remarks We're using [Lazy`1](https://learn.microsoft.com/dotnet/api/system.lazy-1) here to ensure that the module is imported exactly once and only when needed. [Lazy`1](https://learn.microsoft.com/dotnet/api/system.lazy-1) manages the instance for us ## Methods ### DisposeAsync Disposes of #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask DisposeAsync() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### InvokeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask InvokeAsync(string identifier, object[] args = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `identifier` | `string` | - | | `args` | `object?[]?` | - | #### Returns Type: `System.Threading.Tasks.ValueTask` #### Type Parameters * `TValue` - ### InvokeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask InvokeAsync(string identifier, System.Threading.CancellationToken cancellationToken, object[] args = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `identifier` | `string` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | | `args` | `object?[]?` | - | #### Returns Type: `System.Threading.Tasks.ValueTask` #### Type Parameters * `TValue` - ### InvokeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask InvokeAsync(string identifier, System.TimeSpan timeout, object[] args = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `identifier` | `string` | - | | `timeout` | `System.TimeSpan` | - | | `args` | `object?[]?` | - | #### Returns Type: `System.Threading.Tasks.ValueTask` #### Type Parameters * `TValue` - ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.JSInterop.IJSObjectReference * System.IAsyncDisposable # LoadingStatus Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus Outlines the different phases of the loading cycle. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.LoadingStatus ``` ## Summary Outlines the different phases of the loading cycle. ## Values | Name | Value | Description | | - | - | - | | `NotLoaded` | 0 | | | `Loading` | 1 | | | `Failed` | 99 | | | `Loaded` | 100 | | # Operation Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Operation A class with observable elements to describe the different components of reporting operation progress to an end user. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** CloudNimble.BlazorEssentials.BlazorObservable ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.Operation ``` ## Summary A class with observable elements to describe the different components of reporting operation progress to an end user. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public Operation(string title, System.Collections.Generic.IEnumerable steps, string successText, string failureText, string inProgressText = "Working...", string notStartedText = "", bool shouldObserveStatus = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `title` | `string` | - | | `steps` | `System.Collections.Generic.IEnumerable` | - | | `successText` | `string` | Initializer for the Success value on the DisplayText property. | | `failureText` | `string` | Initializer for the Failure value on the DisplayText property. | | `inProgressText` | `string` | Initializer for the InProgress value on the DisplayText property. | | `notStartedText` | `string` | Initializer for the NotStarted value on the DisplayText property. | | `shouldObserveStatus` | `bool` | Initializer for internal flag indicating if the control should trigger the StateHasChanged action in the [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) when the [OperationStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStatus) changes. | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Creates a new instance of the [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) class. #### Syntax ```csharp theme={"dark"} public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - | ## Properties ### CurrentIcon A computed string that determines what the icon should be as the Steps change. #### Syntax ```csharp theme={"dark"} public string CurrentIcon { get; set; } ``` #### Property Value Type: `string` ### CurrentIconColor A computed string that determines what the icon color should be as the Steps change. #### Syntax ```csharp theme={"dark"} public string CurrentIconColor { get; set; } ``` #### Property Value Type: `string` ### CurrentProgressClass A computed string containing the DisplayText for the currently running OperationStep. #### Syntax ```csharp theme={"dark"} public string CurrentProgressClass { get; set; } ``` #### Property Value Type: `string` ### DisplayIcon The icon to display to the end user through the Operation lifecycle. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayIcon { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay` #### Remarks This property is is not observable. ### DisplayIconColor The colors to use for the [Operation.CurrentIcon](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Operation#currenticon) through the Operation lifecycle. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayIconColor { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay` #### Remarks This property is is not observable. ### DisplayProgressClass The CSS Class to use for the Alert's background through the Operation lifecycle. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayProgressClass { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay` #### Remarks This property is is not observable. ### DisplayText The text to display to the end user through the Operation lifecycle. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayText { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay` #### Remarks This property is is not observable. ### LoadingStatus Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` A [BlazorObservable.LoadingStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable#loadingstatus) specifying the current state of the required data for this Observable. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.LoadingStatus` ### ProgressPercent A computed number containing the percentage of all the OperationSteps in the "Succeeded" status. #### Syntax ```csharp theme={"dark"} public System.Decimal ProgressPercent { get; set; } ``` #### Property Value Type: `System.Decimal` ### ProgressText A computed string containing the DisplayText for the currently running OperationStep. #### Syntax ```csharp theme={"dark"} public string ProgressText { get; set; } ``` #### Property Value Type: `string` ### ResultText A computed string that determines if we display the SuccessText or FailureText based on the collective outcome of all the Steps. #### Syntax ```csharp theme={"dark"} public string ResultText { get; set; } ``` #### Property Value Type: `string` ### ShowPanel A computed boolean specifying whether or not the \
showing the status of this Operation should be displayed. #### Syntax ```csharp theme={"dark"} public bool ShowPanel { get; set; } ``` #### Property Value Type: `bool` ### StateHasChanged Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Determines how to trigger StateHasChanged events in a Blazor component. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig` ### Status A computed boolean specifying whether or not ALL of the OperationSteps are successful. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.OperationStatus Status { get; private set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatus` ### Steps A [ObservableCollection\`1](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1) containing the different steps of the Operation. #### Syntax ```csharp theme={"dark"} public System.Collections.ObjectModel.ObservableCollection Steps { get; set; } ``` #### Property Value Type: `System.Collections.ObjectModel.ObservableCollection` ### Title The text to display to the end user regarding what is happening in this step. #### Syntax ```csharp theme={"dark"} public string Title { get; set; } ``` #### Property Value Type: `string` ## Methods ### Dispose Override Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` #### Syntax ```csharp theme={"dark"} protected override void Dispose(bool disposing) ``` #### Parameters | Name | Type | Description | | - | - | - | | `disposing` | `bool` | - | ### ReplaceSteps #### Syntax ```csharp theme={"dark"} public void ReplaceSteps(System.Collections.Generic.List steps) ``` #### Parameters | Name | Type | Description | | - | - | - | | `steps` | `System.Collections.Generic.List` | - | ### Reset Changes all of the Steps back to "NotStarted" so the Operation can be run again. #### Syntax ```csharp theme={"dark"} public void Reset() ``` ### Start Starts the Operation, looping through each step until it is finished or until a step fails. #### Syntax ```csharp theme={"dark"} public void Start() ``` ### UpdateStep Modify the status of a specific [OperationStep](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep). #### Syntax ```csharp theme={"dark"} public void UpdateStep(int id, CloudNimble.BlazorEssentials.Merlin.OperationStepStatus status, string errorText) ``` #### Parameters | Name | Type | Description | | - | - | - | | `id` | `int` | [OperationStep](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep) identifier. | | `status` | `CloudNimble.BlazorEssentials.Merlin.OperationStepStatus` | New [OperationStepStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStepStatus). | | `errorText` | `string` | New value for the ErrorText property on the [OperationStep](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep). | # OperationStatus Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStatus ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.OperationStatus ``` ## Values | Name | Value | Description | | - | - | - | | `NotStarted` | 0 | | | `InProgress` | 1 | | | `Failed` | 99 | | | `Succeeded` | 100 | | # OperationStatusDisplay Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStatusDisplay An object to store display values represented by specific statuses for an [Operation](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Operation) or [Opera... ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay ``` ## Summary An object to store display values represented by specific statuses for an [Operation](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Operation) or [OperationStep](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep). ## Constructors ### .ctor Constructor overload to set only success / failure texts. #### Syntax ```csharp theme={"dark"} public OperationStatusDisplay(string success, string failure) ``` #### Parameters | Name | Type | Description | | - | - | - | | `success` | `string` | Initializer for Success text. | | `failure` | `string` | Initializer for Failure text. | ### .ctor Constructor overload to set all texts. #### Syntax ```csharp theme={"dark"} public OperationStatusDisplay(string success, string failure, string inProgress, string notStarted) ``` #### Parameters | Name | Type | Description | | - | - | - | | `success` | `string` | Initializer for Success text. | | `failure` | `string` | Initializer for Failure text. | | `inProgress` | `string` | Initializer for InProgress text. | | `notStarted` | `string` | Initializer for NotStarted text. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Failure Text to display when the operation has failed. #### Syntax ```csharp theme={"dark"} public string Failure { get; set; } ``` #### Property Value Type: `string` ### InProgress Text to display while the operation is in progress. #### Syntax ```csharp theme={"dark"} public string InProgress { get; set; } ``` #### Property Value Type: `string` ### NotStarted Text to display when the operation has not started. #### Syntax ```csharp theme={"dark"} public string NotStarted { get; set; } ``` #### Property Value Type: `string` ### Success Text to display when the operation has succeeded. #### Syntax ```csharp theme={"dark"} public string Success { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # OperationStep Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** CloudNimble.BlazorEssentials.BlazorObservable ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.OperationStep ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public OperationStep(int id, string displayText, System.Func> onAction) ``` #### Parameters | Name | Type | Description | | - | - | - | | `id` | `int` | - | | `displayText` | `string` | - | | `onAction` | `System.Func>` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Creates a new instance of the [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) class. #### Syntax ```csharp theme={"dark"} public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - | ## Properties ### DisplayText The text to display to the end user regarding what is happening in this step. #### Syntax ```csharp theme={"dark"} public string DisplayText { get; set; } ``` #### Property Value Type: `string` ### ErrorText Any additional text you'd like to display to the end user when there is an error. #### Syntax ```csharp theme={"dark"} public string ErrorText { get; set; } ``` #### Property Value Type: `string` ### Id A zero-based index identifying this step in relation to other steps in the process. #### Syntax ```csharp theme={"dark"} public int Id { get; set; } ``` #### Property Value Type: `int` ### Label Returns a Bootstrap Label with the details of the a given [OperationStep.Status](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep#status). #### Syntax ```csharp theme={"dark"} public string Label { get; set; } ``` #### Property Value Type: `string` ### LoadingStatus Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` A [BlazorObservable.LoadingStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable#loadingstatus) specifying the current state of the required data for this Observable. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.LoadingStatus` ### OnAction An async function that returns a boolean indicating whether or not the action succeeded. #### Syntax ```csharp theme={"dark"} public System.Func> OnAction { get; set; } ``` #### Property Value Type: `System.Func>` ### StateHasChanged Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Determines how to trigger StateHasChanged events in a Blazor component. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig` ### Status An OperationStepStatus where you can change the operation's status and the UI is re-rendered automatically. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.OperationStepStatus Status { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.OperationStepStatus` ## Methods ### Dispose Override Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` #### Syntax ```csharp theme={"dark"} protected override void Dispose(bool disposing) ``` #### Parameters | Name | Type | Description | | - | - | - | | `disposing` | `bool` | - | ### Reset Resets the status of the OperationStep in the event it needs to run again. #### Syntax ```csharp theme={"dark"} public void Reset() ``` ### Start The Action that the Operation calls to trigger a Step. It wrapps the call to onAction with status update logic. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task Start() ``` #### Returns Type: `System.Threading.Tasks.Task` # OperationStepStatus Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStepStatus ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.OperationStepStatus ``` ## Values | Name | Value | Description | | - | - | - | | `NotStarted` | 0 | | | `InProgress` | 1 | | | `Failed` | 99 | | | `Succeeded` | 100 | | # Wizard Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Wizard ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** Microsoft.AspNetCore.Components.ComponentBase ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.Wizard ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public Wizard() ``` ## Properties ### ContainerTemplate #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment ContainerTemplate { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### CurrentPane #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.WizardPane CurrentPane { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.WizardPane` ### FooterTemplate #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment FooterTemplate { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### HeaderTemplate #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment HeaderTemplate { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### IsBackEnabled #### Syntax ```csharp theme={"dark"} public bool IsBackEnabled { get; } ``` #### Property Value Type: `bool` ### IsFinishVisible #### Syntax ```csharp theme={"dark"} public bool IsFinishVisible { get; } ``` #### Property Value Type: `bool` ### IsNextEnabled #### Syntax ```csharp theme={"dark"} public bool IsNextEnabled { get; } ``` #### Property Value Type: `bool` ### IsNextVisible #### Syntax ```csharp theme={"dark"} public bool IsNextVisible { get; } ``` #### Property Value Type: `bool` ### IsOperationStartVisible #### Syntax ```csharp theme={"dark"} public bool IsOperationStartVisible { get; } ``` #### Property Value Type: `bool` ### Operation #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.Operation Operation { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.Operation` ### Panes #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Panes { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### PanesContent #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment PanesContent { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### Title #### Syntax ```csharp theme={"dark"} public string Title { get; set; } ``` #### Property Value Type: `string` ## Methods ### Back #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task Back() ``` #### Returns Type: `System.Threading.Tasks.Task` ### Next #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task Next() ``` #### Returns Type: `System.Threading.Tasks.Task` ### Reset #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task Reset(bool clearPanes = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `clearPanes` | `bool` | - | #### Returns Type: `System.Threading.Tasks.Task` ### StartOperation #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task StartOperation() ``` #### Returns Type: `System.Threading.Tasks.Task` ## Related APIs * System.IDisposable # WizardPane Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPane ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** Microsoft.AspNetCore.Components.ComponentBase ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.WizardPane ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WizardPane() ``` ## Properties ### ChildContent #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.Components.RenderFragment ChildContent { get; set; } ``` #### Property Value Type: `Microsoft.AspNetCore.Components.RenderFragment` ### Description #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string` ### IsNextEnabled #### Syntax ```csharp theme={"dark"} public bool IsNextEnabled { get; set; } ``` #### Property Value Type: `bool` ### NextLabel #### Syntax ```csharp theme={"dark"} public string NextLabel { get; set; } ``` #### Property Value Type: `string` ### OnBackAction #### Syntax ```csharp theme={"dark"} public System.Action OnBackAction { get; set; } ``` #### Property Value Type: `System.Action` ### OnNextAction #### Syntax ```csharp theme={"dark"} public System.Func> OnNextAction { get; set; } ``` #### Property Value Type: `System.Func>` ### Parent #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.Wizard Parent { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.Wizard` ### Status #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.WizardPaneStatus Status { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.WizardPaneStatus` ### Title #### Syntax ```csharp theme={"dark"} public string Title { get; set; } ``` #### Property Value Type: `string` ### Type #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Merlin.WizardPaneType Type { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Merlin.WizardPaneType` # WizardPaneStatus Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPaneStatus ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.WizardPaneStatus ``` ## Values | Name | Value | Description | | - | - | - | | `NotStarted` | 0 | | | `InProgress` | 1 | | | `Failed` | 99 | | | `Succeeded` | 100 | | # WizardPaneType Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPaneType ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Merlin **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Merlin.WizardPaneType ``` ## Values | Name | Value | Description | | - | - | - | | `Normal` | 0 | | | `Confirmation` | 1 | | | `Completed` | 2 | | # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/index Summary of the CloudNimble.BlazorEssentials.Merlin Namespace ## Types ### Classes | Name | Summary | | - | - | | [Operation](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Operation) | A class with observable elements to describe the different components of reporting operation progress to an end user. | | [OperationStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStatus) | | | [OperationStatusDisplay](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStatusDisplay) | An object to store display values represented by specific statuses for an [Operation](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Operation) or [OperationStep](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep). | | [OperationStep](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep) | | | [OperationStepStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStepStatus) | | | [WizardPaneStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPaneStatus) | | | [WizardPaneType](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPaneType) | | | [WizardPane](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPane) | | | [Wizard](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Wizard) | | ### Enums | Name | Summary | | - | - | | [OperationStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStatus) | | | [OperationStepStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStepStatus) | | | [WizardPaneStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPaneStatus) | | | [WizardPaneType](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/WizardPaneType) | | # ActionButton Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButton Defines a button that can be used to trigger an action in a User Interface. Useful for binding aq group of actions programmatically. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Navigation **Inheritance:** CloudNimble.BlazorEssentials.Navigation.ActionButtonBase ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Navigation.ActionButton ``` ## Summary Defines a button that can be used to trigger an action in a User Interface. Useful for binding aq group of actions programmatically. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ActionButton() ``` ### .ctor Creates a new [ActionButton](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButton) instance specifically for icon-only buttons, usually in the header or footer. #### Syntax ```csharp theme={"dark"} public ActionButton(string iconClass, string tooltip, System.Action actionMethod = null, System.Func isDisabledFunc = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `iconClass` | `string` | - | | `tooltip` | `string` | - | | `actionMethod` | `System.Action` | - | | `isDisabledFunc` | `System.Func` | - | ### .ctor #### Syntax ```csharp theme={"dark"} public ActionButton(string buttonText, string buttonClass, string iconClass, string popoverName, string popoverHeader, string popoverPlacement, System.Func isDisabledFunc = null, System.Collections.Generic.List children = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `buttonText` | `string` | - | | `buttonClass` | `string` | - | | `iconClass` | `string` | - | | `popoverName` | `string` | - | | `popoverHeader` | `string` | - | | `popoverPlacement` | `string` | - | | `isDisabledFunc` | `System.Func` | - | | `children` | `System.Collections.Generic.List` | - | ### .ctor #### Syntax ```csharp theme={"dark"} public ActionButton(string buttonText, string buttonClass, string iconClass, System.Action actionMethod = null, System.Func isDisabledFunc = null, string tooltip = null, string tooltipContainer = "body") ``` #### Parameters | Name | Type | Description | | - | - | - | | `buttonText` | `string` | - | | `buttonClass` | `string` | - | | `iconClass` | `string` | - | | `actionMethod` | `System.Action` | - | | `isDisabledFunc` | `System.Func` | - | | `tooltip` | `string` | - | | `tooltipContainer` | `string` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public ActionButtonBase() ``` ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` Creates a new [ActionButton](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButton) instance specifically for icon-only buttons, usually in the header or footer. #### Syntax ```csharp theme={"dark"} public ActionButtonBase(string iconClass, string tooltip, System.Func isDisabledFunc = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `iconClass` | `string` | - | | `tooltip` | `string` | - | | `isDisabledFunc` | `System.Func` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public ActionButtonBase(string buttonText, string buttonClass, string iconClass, string popoverName, string popoverHeader, string popoverPlacement, System.Func isDisabledFunc = null, System.Collections.Generic.List children = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `buttonText` | `string` | - | | `buttonClass` | `string` | - | | `iconClass` | `string` | - | | `popoverName` | `string` | - | | `popoverHeader` | `string` | - | | `popoverPlacement` | `string` | - | | `isDisabledFunc` | `System.Func` | - | | `children` | `System.Collections.Generic.List` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public ActionButtonBase(string buttonText, string buttonClass, string iconClass, System.Func isDisabledFunc = null, string tooltip = null, string tooltipContainer = "body") ``` #### Parameters | Name | Type | Description | | - | - | - | | `buttonText` | `string` | - | | `buttonClass` | `string` | - | | `iconClass` | `string` | - | | `isDisabledFunc` | `System.Func` | - | | `tooltip` | `string` | - | | `tooltipContainer` | `string` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` #### Syntax ```csharp theme={"dark"} public InterfaceElement() ``` ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` #### Syntax ```csharp theme={"dark"} public InterfaceElement(string displayText, string iconClass, string cssClass = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `displayText` | `string` | - | | `iconClass` | `string` | - | | `cssClass` | `string` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AccessibilityText Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` Test to be used for screen readers when this item is rendered. #### Syntax ```csharp theme={"dark"} public string AccessibilityText { get; set; } ``` #### Property Value Type: `string` ### ActionMethod A lambda expression that will be executed when the button is clicked. #### Syntax ```csharp theme={"dark"} public System.Action ActionMethod { get; set; } ``` #### Property Value Type: `System.Action` ### Children Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Children { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### CssClass Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the CSS classes that will be applied to the element. #### Syntax ```csharp theme={"dark"} public string CssClass { get; set; } ``` #### Property Value Type: `string` ### DisplayText Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the text that will be displayed inside the element. #### Syntax ```csharp theme={"dark"} public string DisplayText { get; set; } ``` #### Property Value Type: `string` ### IconClass Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the CSS class for the icon that will be rendered immediately before the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). #### Syntax ```csharp theme={"dark"} public string IconClass { get; set; } ``` #### Property Value Type: `string` ### IsDisabledFunc Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public System.Func IsDisabledFunc { get; set; } ``` #### Property Value Type: `System.Func` ### ModalTarget Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public string ModalTarget { get; set; } ``` #### Property Value Type: `string` ### PopoverHeader Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public string PopoverHeader { get; set; } ``` #### Property Value Type: `string` ### PopoverName Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public string PopoverName { get; set; } ``` #### Property Value Type: `string` ### PopoverPlacement Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public string PopoverPlacement { get; set; } ``` #### Property Value Type: `string` ### Tooltip Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` The text that will be displayed to the end user when the cursor is hovered over the button. #### Syntax ```csharp theme={"dark"} public string Tooltip { get; set; } ``` #### Property Value Type: `string` ### TooltipContainer Inherited Inherited from `CloudNimble.BlazorEssentials.Navigation.ActionButtonBase` #### Syntax ```csharp theme={"dark"} public string TooltipContainer { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ActionButtonBase Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButtonBase Defines a button that can be used to trigger an action in a User Interface. Useful for binding aq group of actions programmatically. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Navigation **Inheritance:** CloudNimble.BlazorEssentials.InterfaceElement ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Navigation.ActionButtonBase ``` ## Summary Defines a button that can be used to trigger an action in a User Interface. Useful for binding aq group of actions programmatically. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ActionButtonBase() ``` ### .ctor Creates a new [ActionButton](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButton) instance specifically for icon-only buttons, usually in the header or footer. #### Syntax ```csharp theme={"dark"} public ActionButtonBase(string iconClass, string tooltip, System.Func isDisabledFunc = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `iconClass` | `string` | - | | `tooltip` | `string` | - | | `isDisabledFunc` | `System.Func` | - | ### .ctor #### Syntax ```csharp theme={"dark"} public ActionButtonBase(string buttonText, string buttonClass, string iconClass, string popoverName, string popoverHeader, string popoverPlacement, System.Func isDisabledFunc = null, System.Collections.Generic.List children = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `buttonText` | `string` | - | | `buttonClass` | `string` | - | | `iconClass` | `string` | - | | `popoverName` | `string` | - | | `popoverHeader` | `string` | - | | `popoverPlacement` | `string` | - | | `isDisabledFunc` | `System.Func` | - | | `children` | `System.Collections.Generic.List` | - | ### .ctor #### Syntax ```csharp theme={"dark"} public ActionButtonBase(string buttonText, string buttonClass, string iconClass, System.Func isDisabledFunc = null, string tooltip = null, string tooltipContainer = "body") ``` #### Parameters | Name | Type | Description | | - | - | - | | `buttonText` | `string` | - | | `buttonClass` | `string` | - | | `iconClass` | `string` | - | | `isDisabledFunc` | `System.Func` | - | | `tooltip` | `string` | - | | `tooltipContainer` | `string` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` #### Syntax ```csharp theme={"dark"} public InterfaceElement() ``` ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` #### Syntax ```csharp theme={"dark"} public InterfaceElement(string displayText, string iconClass, string cssClass = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `displayText` | `string` | - | | `iconClass` | `string` | - | | `cssClass` | `string` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AccessibilityText Test to be used for screen readers when this item is rendered. #### Syntax ```csharp theme={"dark"} public string AccessibilityText { get; set; } ``` #### Property Value Type: `string` ### Children #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Children { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### CssClass Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the CSS classes that will be applied to the element. #### Syntax ```csharp theme={"dark"} public string CssClass { get; set; } ``` #### Property Value Type: `string` ### DisplayText Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the text that will be displayed inside the element. #### Syntax ```csharp theme={"dark"} public string DisplayText { get; set; } ``` #### Property Value Type: `string` ### IconClass Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the CSS class for the icon that will be rendered immediately before the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). #### Syntax ```csharp theme={"dark"} public string IconClass { get; set; } ``` #### Property Value Type: `string` ### IsDisabledFunc #### Syntax ```csharp theme={"dark"} public System.Func IsDisabledFunc { get; set; } ``` #### Property Value Type: `System.Func` ### ModalTarget #### Syntax ```csharp theme={"dark"} public string ModalTarget { get; set; } ``` #### Property Value Type: `string` ### PopoverHeader #### Syntax ```csharp theme={"dark"} public string PopoverHeader { get; set; } ``` #### Property Value Type: `string` ### PopoverName #### Syntax ```csharp theme={"dark"} public string PopoverName { get; set; } ``` #### Property Value Type: `string` ### PopoverPlacement #### Syntax ```csharp theme={"dark"} public string PopoverPlacement { get; set; } ``` #### Property Value Type: `string` ### Tooltip The text that will be displayed to the end user when the cursor is hovered over the button. #### Syntax ```csharp theme={"dark"} public string Tooltip { get; set; } ``` #### Property Value Type: `string` ### TooltipContainer #### Syntax ```csharp theme={"dark"} public string TooltipContainer { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NavigationHistory Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationHistory ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Navigation **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Navigation.NavigationHistory ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationHistory(Microsoft.JSInterop.IJSRuntime jsRuntime) ``` #### Parameters | Name | Type | Description | | - | - | - | | `jsRuntime` | `Microsoft.JSInterop.IJSRuntime` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Back This asynchronous method goes to the previous page in session history. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask Back() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### Count Returns an Integer representing the number of elements in the session history, including the currently loaded page. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask Count() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### CurrentState Returns an *T* type representing the state at the top of the history stack. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask CurrentState() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` #### Type Parameters * `T` - The type of the state data ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Forward This asynchronous method goes to the next page in session history. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask Forward() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetScrollRestoration Allows web applications to explicitly get default scroll restoration behavior on history navigation. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask GetScrollRestoration() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Go Asynchronously loads a page from the session history, identified by its relative location to the current page. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask Go(int index) ``` #### Parameters | Name | Type | Description | | - | - | - | | `index` | `int` | The index to move back or forward | #### Returns Type: `System.Threading.Tasks.ValueTask` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PushState Pushes the given data onto the session history stack. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask PushState(T state, string url) ``` #### Parameters | Name | Type | Description | | - | - | - | | `state` | `T` | The state of the data | | `url` | `string` | The url to navigate | #### Returns Type: `System.Threading.Tasks.ValueTask` #### Type Parameters * `T` - The type of the state data ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ReplaceState Updates the most recent entry on the history stack. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask ReplaceState(T state, string url) ``` #### Parameters | Name | Type | Description | | - | - | - | | `state` | `T` | The state of the data | | `url` | `string` | The url to navigate | #### Returns Type: `System.Threading.Tasks.ValueTask` #### Type Parameters * `T` - The type of the state data ### SetScrollRestoration Allows web applications to explicitly set default scroll restoration behavior on history navigation. This property can be either auto or manual. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask SetScrollRestoration(CloudNimble.BlazorEssentials.Navigation.ScrollRestorationType scrollRestorationType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `scrollRestorationType` | `CloudNimble.BlazorEssentials.Navigation.ScrollRestorationType` | - | #### Returns Type: `System.Threading.Tasks.ValueTask` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NavigationItem Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem Defines an app navigation structure suitable for binding to navigation menus. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Navigation **Inheritance:** CloudNimble.BlazorEssentials.InterfaceElement ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Navigation.NavigationItem ``` ## Summary Defines an app navigation structure suitable for binding to navigation menus. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationItem() ``` ### .ctor Creates a new instance with the minimum-required items to render a Blazor NavLink. #### Syntax ```csharp theme={"dark"} public NavigationItem(string text, string icon, string url) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | A string representing the text that will be displayed in the NavBar. | | `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). | | `url` | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). | ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationItem(string text, string icon, string url, string category) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | A string representing the text that will be displayed in the NavBar. | | `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). | | `url` | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). | | `category` | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping | | [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\ into caregories for display. | | | ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationItem(string text, string icon, string url, string category, bool isVisible) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | A string representing the text that will be displayed in the NavBar. | | `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). | | `url` | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). | | `category` | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping | | [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\ into caregories for display. | | | | `isVisible` | `bool` | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) is visible on the NavBar. | ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationItem(string text, string icon, string category, bool isVisible, System.Collections.Generic.List children) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | A string representing the text that will be displayed in the NavBar. | | `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). | | `category` | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping | | [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\ into caregories for display. | | | | `isVisible` | `bool` | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) is visible on the NavBar. | | `children` | `System.Collections.Generic.List` | A [List\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) containing nodes to render underneath this one. | ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationItem(string text, string icon, string url, string category, bool isVisible, string pageTitle, string pageIcon) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | A string representing the text that will be displayed in the NavBar. | | `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). | | `url` | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). | | `category` | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping | | [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\ into caregories for display. | | | | `isVisible` | `bool` | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) is visible on the NavBar. | | `pageTitle` | `string` | A string representing the text that can be displayed as a page header. | | `pageIcon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [NavigationItem.PageTitle](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem#pagetitle) in a page header. | ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationItem(string text, string icon, string url, string category, bool isVisible, string pageTitle, string pageIcon, string roles, bool allowAnonymous = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | A string representing the text that will be displayed in the NavBar. | | `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). | | `url` | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). | | `category` | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping | | [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\ into caregories for display. | | | | `isVisible` | `bool` | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) is visible on the NavBar. | | `pageTitle` | `string` | A string representing the text that can be displayed as a page header. | | `pageIcon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [NavigationItem.PageTitle](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem#pagetitle) in a page header. | | `roles` | `string` | - | | `allowAnonymous` | `bool` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` #### Syntax ```csharp theme={"dark"} public InterfaceElement() ``` ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` #### Syntax ```csharp theme={"dark"} public InterfaceElement(string displayText, string iconClass, string cssClass = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `displayText` | `string` | - | | `iconClass` | `string` | - | | `cssClass` | `string` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AccessibilityText Test to be used for screen readers when this item is rendered. #### Syntax ```csharp theme={"dark"} public string AccessibilityText { get; set; } ``` #### Property Value Type: `string` ### AllowAnonymous A [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) is visible when a user is not logged in. #### Syntax ```csharp theme={"dark"} public bool AllowAnonymous { get; } ``` #### Property Value Type: `bool` ### Category A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be left blank, but useful for grouping [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\ into caregories for display. #### Syntax ```csharp theme={"dark"} public string Category { get; set; } ``` #### Property Value Type: `string` ### Children #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Children { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### CssClass Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the CSS classes that will be applied to the element. #### Syntax ```csharp theme={"dark"} public string CssClass { get; set; } ``` #### Property Value Type: `string` ### DisplayText Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the text that will be displayed inside the element. #### Syntax ```csharp theme={"dark"} public string DisplayText { get; set; } ``` #### Property Value Type: `string` ### IconClass Inherited Inherited from `CloudNimble.BlazorEssentials.InterfaceElement` A string representing the CSS class for the icon that will be rendered immediately before the [InterfaceElement.DisplayText](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). #### Syntax ```csharp theme={"dark"} public string IconClass { get; set; } ``` #### Property Value Type: `string` ### IsVisible Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) is visible on the NavBar. Defaults to True. #### Syntax ```csharp theme={"dark"} public bool IsVisible { get; set; } ``` #### Property Value Type: `bool` ### PageIcon A string representing the CSS class(es) for the icon that can be displayed next to the [NavigationItem.PageTitle](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem#pagetitle) in a page header. #### Syntax ```csharp theme={"dark"} public string PageIcon { get; set; } ``` #### Property Value Type: `string` ### PageTitle A string representing the text that can be displayed as a page header. #### Syntax ```csharp theme={"dark"} public string PageTitle { get; set; } ``` #### Property Value Type: `string` ### Parameters Allows you to set parameters specific to the page that you do NOT want to pass through the Routing system. #### Syntax ```csharp theme={"dark"} public dynamic Parameters { get; set; } ``` #### Property Value Type: `dynamic` #### Remarks Accessible through [AppStateBase.CurrentNavItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#currentnavitem). ### Roles A [HashSet\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1) of roles that this NavigationItem is visible to. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet Roles { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` ### Url A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### IsVisibleToUser Returns a boolean indicating whether or not the NavItem is available to any of the Roles the *claimsPrincipal* is in. #### Syntax ```csharp theme={"dark"} public bool IsVisibleToUser(System.Security.Claims.ClaimsPrincipal claimsPrincipal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `claimsPrincipal` | `System.Security.Claims.ClaimsPrincipal` | - | #### Returns Type: `bool` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ScrollRestorationType Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ScrollRestorationType Represents the scroll restoration behavior on history navigation. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Navigation **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Navigation.ScrollRestorationType ``` ## Summary Represents the scroll restoration behavior on history navigation. ## Values | Name | Value | Description | | - | - | - | | `Auto` | 0 | The location on the page to which the user has scrolled will be restored. | | `Manual` | 1 | The location on the page is not restored. The user will have to scroll to the location manually. | # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/index Summary of the CloudNimble.BlazorEssentials.Navigation Namespace ## Types ### Classes | Name | Summary | | - | - | | [ActionButton](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButton) | Defines a button that can be used to trigger an action in a User Interface. Useful for binding aq group of actions programmatically. | | [ActionButton](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButton) | Defines a button that can be used to trigger an action in a User Interface. Useful for binding aq group of actions programmatically. | | [ActionButtonBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ActionButtonBase) | Defines a button that can be used to trigger an action in a User Interface. Useful for binding aq group of actions programmatically. | | [NavigationHistory](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationHistory) | | | [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) | Defines an app navigation structure suitable for binding to navigation menus. | | [ScrollRestorationType](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ScrollRestorationType) | Represents the scroll restoration behavior on history navigation. | ### Enums | Name | Summary | | - | - | | [ScrollRestorationType](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/ScrollRestorationType) | Represents the scroll restoration behavior on history navigation. | # CrossOriginIsolationMiddleware Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationMiddleware Middleware that adds Cross-Origin Isolation headers (COOP and COEP) to responses. These headers are required for features like SharedArrayBuffer... ## Definition **Assembly:** CloudNimble.BlazorEssentials.Server.dll **Namespace:** CloudNimble.BlazorEssentials.Server.Middleware **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Server.Middleware.CrossOriginIsolationMiddleware ``` ## Summary Middleware that adds Cross-Origin Isolation headers (COOP and COEP) to responses. These headers are required for features like SharedArrayBuffer and high-resolution timers, which are needed by WASM libraries like TursoDb that use OPFS (Origin Private File System). ## Remarks \Warning:\ Enabling cross-origin isolation may break third-party scripts, iframes, and CDN resources that are not configured to work in an isolated context. Test thoroughly before enabling in production. Headers added: * `Cross-Origin-Opener-Policy: same-origin` - Isolates the browsing context * `Cross-Origin-Embedder-Policy: require-corp` - Requires all resources to explicitly grant permission ## Examples ```csharp theme={"dark"} // In Program.cs app.UseCrossOriginIsolation(); // Or with options app.UseCrossOriginIsolation(options => { options.CoopPolicy = "same-origin"; options.CoepPolicy = "require-corp"; options.ExcludePaths.Add("/api/"); }); ``` ## Constructors ### .ctor Initializes a new instance of the [CrossOriginIsolationMiddleware](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationMiddleware) class. #### Syntax ```csharp theme={"dark"} public CrossOriginIsolationMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, CloudNimble.BlazorEssentials.Server.Middleware.CrossOriginIsolationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `next` | `Microsoft.AspNetCore.Http.RequestDelegate` | The next middleware in the pipeline. | | `options` | `CloudNimble.BlazorEssentials.Server.Middleware.CrossOriginIsolationOptions?` | Configuration options for cross-origin isolation. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### InvokeAsync Invokes the middleware to add cross-origin isolation headers. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.AspNetCore.Http.HttpContext` | The HTTP context. | #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # CrossOriginIsolationOptions Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationOptions Configuration options for the [CrossOriginIsolationMiddleware](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationMiddleware). ## Definition **Assembly:** CloudNimble.BlazorEssentials.Server.dll **Namespace:** CloudNimble.BlazorEssentials.Server.Middleware **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Server.Middleware.CrossOriginIsolationOptions ``` ## Summary Configuration options for the [CrossOriginIsolationMiddleware](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationMiddleware). ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public CrossOriginIsolationOptions() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CoepPolicy Gets or sets the Cross-Origin-Embedder-Policy value. Default is "require-corp". #### Syntax ```csharp theme={"dark"} public string CoepPolicy { get; set; } ``` #### Property Value Type: `string` #### Remarks Possible values: ### CoopPolicy Gets or sets the Cross-Origin-Opener-Policy value. Default is "same-origin". #### Syntax ```csharp theme={"dark"} public string CoopPolicy { get; set; } ``` #### Property Value Type: `string` #### Remarks Possible values: ### CorpPolicy Gets or sets the Cross-Origin-Resource-Policy value. Default is "same-origin". #### Syntax ```csharp theme={"dark"} public string CorpPolicy { get; set; } ``` #### Property Value Type: `string` #### Remarks Possible values: ### ExcludePaths Gets or sets a list of path prefixes to exclude from cross-origin isolation. Paths starting with these prefixes will not have the headers added. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ExcludePaths { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Examples ```csharp theme={"dark"} options.ExcludePaths.Add("/api/"); options.ExcludePaths.Add("/external/"); ``` ### IncludeCorpHeader Gets or sets whether to include the Cross-Origin-Resource-Policy header. Default is true. #### Syntax ```csharp theme={"dark"} public bool IncludeCorpHeader { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/index Summary of the CloudNimble.BlazorEssentials.Server.Middleware Namespace ## Types ### Classes | Name | Summary | | - | - | | [CrossOriginIsolationMiddleware](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationMiddleware) | Middleware that adds Cross-Origin Isolation headers (COOP and COEP) to responses. These headers are required for features like SharedArrayBuffer and high-resolution timers, which are needed by WASM libraries like TursoDb that use OPFS (Origin Private File System). | | [CrossOriginIsolationOptions](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationOptions) | Configuration options for the [CrossOriginIsolationMiddleware](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Server/Middleware/CrossOriginIsolationMiddleware). | # StateHasChangedConfig Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.StateHasChangedConfig ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public StateHasChangedConfig() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Action Allows the current Blazor container to pass the StateHasChanged action back to the BlazorObservable so ViewModel operations can trigger state changes. #### Syntax ```csharp theme={"dark"} public System.Action Action { get; set; } ``` #### Property Value Type: `System.Action` #### Remarks Will optionally drop intermediate StateHasChanged calls in a rapidly-updating environment, based on [StateHasChangedConfig.DelayMode](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#delaymode) and [StateHasChangedConfig.DelayInterval](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#delayinterval). ### BlazorObservableType The [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable)[Type](https://learn.microsoft.com/dotnet/api/system.type) associated with this Configuration instance. #### Syntax ```csharp theme={"dark"} public System.Type BlazorObservableType { get; set; } ``` #### Property Value Type: `System.Type` ### Count #### Syntax ```csharp theme={"dark"} public int Count { get; set; } ``` #### Property Value Type: `int` #### Remarks This is public so ### DebugMode Flag for whether or not the render count and helpful debug feedback/warnings should be logged to the [Console](https://learn.microsoft.com/dotnet/api/system.console). Default is [StateHasChangedDebugMode.Off](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDebugMode#off). #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedDebugMode DebugMode { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.StateHasChangedDebugMode` ### DelayInterval An [Int32](https://learn.microsoft.com/dotnet/api/system.int32) specifying the number of milliseconds this BlazorObservable should wait between [StateHasChangedConfig.Action](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#action) calls. Default is 100 milliseconds. #### Syntax ```csharp theme={"dark"} public int DelayInterval { get; set; } ``` #### Property Value Type: `int` #### Remarks [StateHasChangedConfig.DelayMode](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#delaymode) must be set to [StateHasChangedDelayMode.Debounce](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDelayMode#debounce) or [StateHasChangedDelayMode.Throttle](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDelayMode#throttle) for this setting to take effect. ### DelayMode A [StateHasChangedConfig.DelayMode](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#delaymode) indicating whether or not this BlazorObservable should reduce the number of times [StateHasChangedConfig.Action](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#action) should be called in a given [StateHasChangedConfig.DelayInterval](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#delayinterval) Default is [StateHasChangedDelayMode.Off](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDelayMode#off). #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedDelayMode DelayMode { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.StateHasChangedDelayMode` ## Methods ### Clone Copies the values from this [StateHasChangedConfig](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig) instance into a new one. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedConfig Clone(CloudNimble.BlazorEssentials.BlazorObservable observable) ``` #### Parameters | Name | Type | Description | | - | - | - | | `observable` | `CloudNimble.BlazorEssentials.BlazorObservable` | The [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) instance the new [StateHasChangedConfig](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig) instance will be used for. | #### Returns Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig` A new [StateHasChangedConfig](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig) instance with the values populated from this instance. #### Remarks This is required because if we used DI to inject a [StateHasChangedConfig](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig) instance, we wouldn't be able to have different configurations per `ViewModelBase`2\`, AND we would end up overwriting the [StateHasChangedConfig.Action](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig#action)Actions\ from other Pages when the value was set. ### Dispose #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IDisposable # StateHasChangedDebugMode Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDebugMode Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.StateHasChangedDebugMode ``` ## Summary Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. ## Values | Name | Value | Description | | - | - | - | | `Off` | 0 | Does not log StateHasChanged calls to the Browser Console. | | `Info` | 1 | Log basic summary information to the Browser Console. | | `Tuning` | 2 | Include performance recommendations in the information logged to the Browser Console. | # StateHasChangedDelayMode Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDelayMode Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.StateHasChangedDelayMode ``` ## Summary Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. ## Values | Name | Value | Description | | - | - | - | | `Off` | 0 | Does not reduce the number of times StateHasChanged is called. | | `Debounce` | 1 | Only fire StateHasChanged if it hasn't been called in X milliseconds. | | `Throttle` | 2 | Only fire StateHasChanged once every X milliseconds. | # DelayDispatcher Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Threading/DelayDispatcher Provides methods to reduce the number of events that are fired, usually so that rapid, imperceptible changes are ignored. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials.Threading **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.Threading.DelayDispatcher ``` ## Summary Provides methods to reduce the number of events that are fired, usually so that rapid, imperceptible changes are ignored. ## Remarks Throttle() ensures that events are throttled by the interval specified. Only the last event in the interval sequence of events fires. Debounce() fires an event only after the specified interval has passed in which no other pending event has fired. Only the last event in the sequence is fired. Adapted from [https://weblog.west-wind.com/posts/2017/Jul/02/Debouncing-and-Throttling-Dispatcher-Events](https://weblog.west-wind.com/posts/2017/Jul/02/Debouncing-and-Throttling-Dispatcher-Events). ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DelayDispatcher() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DelayCount The number of events that have been dropped in a given interval. #### Syntax ```csharp theme={"dark"} public int DelayCount { get; internal set; } ``` #### Property Value Type: `int` #### Remarks This value is reset every time the built-in [Timer](https://learn.microsoft.com/dotnet/api/system.timers.timer) elapses. ### TimerStarted The [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) that a new [Timer](https://learn.microsoft.com/dotnet/api/system.timers.timer) was started, in UTC. #### Syntax ```csharp theme={"dark"} public System.DateTime TimerStarted { get; internal set; } ``` #### Property Value Type: `System.DateTime` ## Methods ### Debounce Debounce an event by resetting the event timeout every time the event is fired. The behavior is that the Action passed is fired only after events stop firing for the given timeout period. Use Debounce when you want events to fire only after events stop firing after the given interval timeout period. Wrap the logic you would normally use in your event code into the Action you pass to this method to debounce the event. Example: [https://gist.github.com/RickStrahl/0519b678f3294e27891f4d4f0608519a](https://gist.github.com/RickStrahl/0519b678f3294e27891f4d4f0608519a) #### Syntax ```csharp theme={"dark"} public void Debounce(int interval, System.Action action, object param = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `interval` | `int` | An [Int32](https://learn.microsoft.com/dotnet/api/system.int32) specifying the [Timer](https://learn.microsoft.com/dotnet/api/system.timers.timer) duration (in milliseconds). | | `action` | `System.Action` | The [Action](https://learn.microsoft.com/dotnet/api/system.action) to fire when the [Timer](https://learn.microsoft.com/dotnet/api/system.timers.timer) elapses. | | `param` | `object` | Any optional parameters to pass to the *action*. | ### Dispose #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Throttle This method throttles events by allowing only 1 event to fire for the given timeout period. Only the last event fired is handled - all others are ignored. Throttle will fire events every timeout ms even if additional events are pending. Use Throttle where you need to ensure that events fire at given intervals. #### Syntax ```csharp theme={"dark"} public void Throttle(int interval, System.Action action, object param = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `interval` | `int` | An [Int32](https://learn.microsoft.com/dotnet/api/system.int32) specifying the [Timer](https://learn.microsoft.com/dotnet/api/system.timers.timer) duration (in milliseconds). | | `action` | `System.Action` | The [Action](https://learn.microsoft.com/dotnet/api/system.action) to fire when the [Timer](https://learn.microsoft.com/dotnet/api/system.timers.timer) elapses. | | `param` | `object` | Any optional parameters to pass to the *action*. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IDisposable # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Threading/index Summary of the CloudNimble.BlazorEssentials.Threading Namespace ## Types ### Classes | Name | Summary | | - | - | | [DelayDispatcher](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Threading/DelayDispatcher) | Provides methods to reduce the number of events that are fired, usually so that rapid, imperceptible changes are ignored. | # ColumnAttribute Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/ColumnAttribute Specifies the column name and optional type for a property. If not specified, the property name is used as the column name. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.ColumnAttribute ``` ## Summary Specifies the column name and optional type for a property. If not specified, the property name is used as the column name. ## Constructors ### .ctor Initializes a new instance of the [ColumnAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/ColumnAttribute) class. #### Syntax ```csharp theme={"dark"} public ColumnAttribute(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The column name in the database. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when name is null or whitespace. | ## Properties ### DefaultValue Gets or sets the default value for the column. #### Syntax ```csharp theme={"dark"} public string DefaultValue { get; set; } ``` #### Property Value Type: `string?` ### Name Gets the column name in the database. #### Syntax ```csharp theme={"dark"} public string Name { get; } ``` #### Property Value Type: `string` ### Nullable Gets or sets whether the column allows NULL values. If not specified, nullability is inferred from the property type. #### Syntax ```csharp theme={"dark"} public System.Nullable Nullable { get; set; } ``` #### Property Value Type: `System.Nullable?` ### Type Gets or sets the SQLite column type (e.g., "TEXT", "INTEGER", "REAL", "BLOB"). If not specified, the type is inferred from the property type. #### Syntax ```csharp theme={"dark"} public string Type { get; set; } ``` #### Property Value Type: `string?` # ITursoDbSet Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/ITursoDbSet Interface for TursoDbSet, used for database discovery. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.ITursoDbSet ``` ## Summary Interface for TursoDbSet, used for database discovery. ## Methods ### GetEntityMetadata Abstract Gets the entity metadata for this DbSet. #### Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata GetEntityMetadata() ``` #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` The entity metadata. # IndexAttribute Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/IndexAttribute Creates an index on the specified column. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.IndexAttribute ``` ## Summary Creates an index on the specified column. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexAttribute() ``` ## Properties ### Name Gets or sets the index name. If not specified, the name is auto-generated as "ix\_\_". #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string?` ### Unique Gets or sets whether the index enforces uniqueness. #### Syntax ```csharp theme={"dark"} public bool Unique { get; set; } ``` #### Property Value Type: `bool` # NotMappedAttribute Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/NotMappedAttribute Excludes a property from database mapping. Properties marked with this attribute will not be included in table creation or CRUD operations. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.NotMappedAttribute ``` ## Summary Excludes a property from database mapping. Properties marked with this attribute will not be included in table creation or CRUD operations. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NotMappedAttribute() ``` # PrimaryKeyAttribute Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/PrimaryKeyAttribute Marks a property as the primary key of the table. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.PrimaryKeyAttribute ``` ## Summary Marks a property as the primary key of the table. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PrimaryKeyAttribute() ``` ## Properties ### AutoIncrement Gets or sets whether the primary key auto-increments. Defaults to true for integer types. #### Syntax ```csharp theme={"dark"} public bool AutoIncrement { get; set; } ``` #### Property Value Type: `bool` # TursoQueryBuilder Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Query/TursoQueryBuilder Provides fluent query building capabilities for TursoDbSet. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb.Query **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder ``` ## Summary Provides fluent query building capabilities for TursoDbSet. ## Type Parameters * `TEntity` - The entity type being queried. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### AnyAsync Checks if any entities match the query. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AnyAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` True if any entities match. ### CountAsync Executes the query and returns the count of matching entities. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` The count of matching entities. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FirstOrDefaultAsync Executes the query and returns the first matching entity, or null. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task FirstOrDefaultAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` The first matching entity or null. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OrderBy Adds an ORDER BY clause (ascending). #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder OrderBy(string column) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column to order by. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### OrderByDescending Adds an ORDER BY clause (descending). #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder OrderByDescending(string column) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column to order by. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Skip Skips the specified number of results. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder Skip(int count) ``` #### Parameters | Name | Type | Description | | - | - | - | | `count` | `int` | The number of results to skip. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### Take Limits the number of results returned. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder Take(int count) ``` #### Parameters | Name | Type | Description | | - | - | - | | `count` | `int` | The maximum number of results. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### ToListAsync Executes the query and returns all matching entities. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> ToListAsync() ``` #### Returns Type: `System.Threading.Tasks.Task>` A list of matching entities. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Where Adds a WHERE clause to the query. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder Where(string clause, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `clause` | `string` | The WHERE clause (e.g., "name = ?" or "age > ?"). | | `parameters` | `object?[]` | The parameters for the clause. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### WhereEquals Adds a WHERE clause for equality. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder WhereEquals(string column, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column name. | | `value` | `object?` | The value to compare. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### WhereIn Adds a WHERE IN clause. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder WhereIn(string column, params object[] values) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column name. | | `values` | `object[]` | The values to match. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### WhereLike Adds a WHERE clause for LIKE matching. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder WhereLike(string column, string pattern) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column name. | | `pattern` | `string` | The LIKE pattern (use % for wildcards). | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### WhereNotNull Adds a WHERE clause for NOT NULL check. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder WhereNotNull(string column) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column name. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. ### WhereNull Adds a WHERE clause for NULL check. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder WhereNull(string column) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column name. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` The query builder for chaining. # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Query/index Summary of the CloudNimble.BlazorEssentials.TursoDb.Query Namespace ## Types ### Classes | Name | Summary | | - | - | | [TursoQueryBuilder](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Query/TursoQueryBuilder) | Provides fluent query building capabilities for TursoDbSet. | # ColumnMetadata Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/ColumnMetadata Contains metadata about a column in a table. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb.Schema **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata ``` ## Summary Contains metadata about a column in a table. ## Constructors ### .ctor Initializes a new instance of the [ColumnMetadata](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/ColumnMetadata) class. #### Syntax ```csharp theme={"dark"} public ColumnMetadata(System.Reflection.PropertyInfo property, string columnName, string sqliteType, bool isPrimaryKey, bool autoIncrement, bool isNullable, string defaultValue, bool hasIndex, bool isUniqueIndex, string indexName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `property` | `System.Reflection.PropertyInfo` | - | | `columnName` | `string` | - | | `sqliteType` | `string` | - | | `isPrimaryKey` | `bool` | - | | `autoIncrement` | `bool` | - | | `isNullable` | `bool` | - | | `defaultValue` | `string?` | - | | `hasIndex` | `bool` | - | | `isUniqueIndex` | `bool` | - | | `indexName` | `string?` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AutoIncrement Gets whether the primary key auto-increments. #### Syntax ```csharp theme={"dark"} public bool AutoIncrement { get; } ``` #### Property Value Type: `bool` ### ColumnName Gets the column name in the database. #### Syntax ```csharp theme={"dark"} public string ColumnName { get; } ``` #### Property Value Type: `string` ### DefaultValue Gets the default value for the column, or null if none. #### Syntax ```csharp theme={"dark"} public string DefaultValue { get; } ``` #### Property Value Type: `string?` ### HasIndex Gets whether this column has an index. #### Syntax ```csharp theme={"dark"} public bool HasIndex { get; } ``` #### Property Value Type: `bool` ### IndexName Gets the index name, if any. #### Syntax ```csharp theme={"dark"} public string IndexName { get; } ``` #### Property Value Type: `string?` ### IsNullable Gets whether the column allows NULL values. #### Syntax ```csharp theme={"dark"} public bool IsNullable { get; } ``` #### Property Value Type: `bool` ### IsPrimaryKey Gets whether this column is the primary key. #### Syntax ```csharp theme={"dark"} public bool IsPrimaryKey { get; } ``` #### Property Value Type: `bool` ### IsUniqueIndex Gets whether the index is unique. #### Syntax ```csharp theme={"dark"} public bool IsUniqueIndex { get; } ``` #### Property Value Type: `bool` ### Property Gets the property info for this column. #### Syntax ```csharp theme={"dark"} public System.Reflection.PropertyInfo Property { get; } ``` #### Property Value Type: `System.Reflection.PropertyInfo` ### SqliteType Gets the SQLite type for this column. #### Syntax ```csharp theme={"dark"} public string SqliteType { get; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### GetValue Gets the value of this column from an entity instance. #### Syntax ```csharp theme={"dark"} public object GetValue(object entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `object` | The entity instance. | #### Returns Type: `object?` The column value. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetValue Sets the value of this column on an entity instance. #### Syntax ```csharp theme={"dark"} public void SetValue(object entity, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `object` | The entity instance. | | `value` | `object?` | The value to set. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EntityMetadata Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/EntityMetadata Contains metadata about an entity type for database operations. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb.Schema **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata ``` ## Summary Contains metadata about an entity type for database operations. ## Constructors ### .ctor Initializes a new instance of the [EntityMetadata](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/EntityMetadata) class. #### Syntax ```csharp theme={"dark"} public EntityMetadata(System.Type entityType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `System.Type` | The entity type to analyze. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Columns Gets the list of columns in the entity. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyList Columns { get; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyList` ### EntityType Gets the entity type. #### Syntax ```csharp theme={"dark"} public System.Type EntityType { get; } ``` #### Property Value Type: `System.Type` ### NonKeyColumns Gets the columns that are not the primary key. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyList NonKeyColumns { get; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyList` ### PrimaryKey Gets the primary key column, or null if none. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata PrimaryKey { get; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.TursoDb.Schema.ColumnMetadata?` ### TableName Gets the table name in the database. #### Syntax ```csharp theme={"dark"} public string TableName { get; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetInsertData Gets the column values for insert, excluding auto-increment primary keys with default values. #### Syntax ```csharp theme={"dark"} public (string, string, object[]) GetInsertData(object entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `object` | The entity instance. | #### Returns Type: `(string, string, object?[])` Column names, placeholders, and parameter values. ### GetPrimaryKeyValue Gets the primary key value from an entity. #### Syntax ```csharp theme={"dark"} public object GetPrimaryKeyValue(object entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `object` | The entity instance. | #### Returns Type: `object?` The primary key value. #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown when no primary key is defined. | ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### GetUpdateData Gets the column values for update, excluding the primary key. #### Syntax ```csharp theme={"dark"} public (string, object[]) GetUpdateData(object entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `object` | The entity instance. | #### Returns Type: `(string, object?[])` SET clause and parameter values including the primary key. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetPrimaryKeyValue Sets the primary key value on an entity. #### Syntax ```csharp theme={"dark"} public void SetPrimaryKeyValue(object entity, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `object` | The entity instance. | | `value` | `object?` | The primary key value. | #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown when no primary key is defined. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EntityMetadataCache Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/EntityMetadataCache Caches entity metadata for performance. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb.Schema **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadataCache ``` ## Summary Caches entity metadata for performance. ## Methods ### Clear Clears all cached metadata. #### Syntax ```csharp theme={"dark"} public static void Clear() ``` ### GetOrCreate Gets or creates metadata for the specified entity type. #### Syntax ```csharp theme={"dark"} public static CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata GetOrCreate() where TEntity : class ``` #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` The entity metadata. #### Type Parameters * `TEntity` - The entity type. ### GetOrCreate Gets or creates metadata for the specified entity type. #### Syntax ```csharp theme={"dark"} public static CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata GetOrCreate(System.Type entityType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `System.Type` | The entity type. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` The entity metadata. # SqlGenerator Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/SqlGenerator Generates SQL DDL statements from entity metadata. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb.Schema **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.Schema.SqlGenerator ``` ## Summary Generates SQL DDL statements from entity metadata. ## Methods ### GenerateAllDdl Generates all DDL statements needed to create the table and indexes. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable GenerateAllDdl(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | #### Returns Type: `System.Collections.Generic.IEnumerable` All SQL DDL statements. ### GenerateCount Generates a SELECT COUNT(\*) statement. #### Syntax ```csharp theme={"dark"} public static string GenerateCount(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | #### Returns Type: `string` The SQL COUNT statement. ### GenerateCreateIndexes Generates CREATE INDEX statements for all indexed columns. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable GenerateCreateIndexes(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | #### Returns Type: `System.Collections.Generic.IEnumerable` The SQL CREATE INDEX statements. ### GenerateCreateTable Generates a CREATE TABLE IF NOT EXISTS statement for the entity. #### Syntax ```csharp theme={"dark"} public static string GenerateCreateTable(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | #### Returns Type: `string` The SQL CREATE TABLE statement. ### GenerateDelete Generates a DELETE statement for the entity. #### Syntax ```csharp theme={"dark"} public static string GenerateDelete(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | #### Returns Type: `string` The SQL DELETE statement. ### GenerateInsert Generates an INSERT statement for the entity. #### Syntax ```csharp theme={"dark"} public static string GenerateInsert(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata, string columns, string placeholders) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | | `columns` | `string` | The column names. | | `placeholders` | `string` | The parameter placeholders. | #### Returns Type: `string` The SQL INSERT statement. ### GenerateSelectAll Generates a SELECT \* statement for the entity. #### Syntax ```csharp theme={"dark"} public static string GenerateSelectAll(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | #### Returns Type: `string` The SQL SELECT statement. ### GenerateSelectByKey Generates a SELECT statement to find by primary key. #### Syntax ```csharp theme={"dark"} public static string GenerateSelectByKey(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | #### Returns Type: `string` The SQL SELECT statement. ### GenerateUpdate Generates an UPDATE statement for the entity. #### Syntax ```csharp theme={"dark"} public static string GenerateUpdate(CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata metadata, string setClause) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` | The entity metadata. | | `setClause` | `string` | The SET clause. | #### Returns Type: `string` The SQL UPDATE statement. # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/index Summary of the CloudNimble.BlazorEssentials.TursoDb.Schema Namespace ## Types ### Classes | Name | Summary | | - | - | | [ColumnMetadata](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/ColumnMetadata) | Contains metadata about a column in a table. | | [EntityMetadata](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/EntityMetadata) | Contains metadata about an entity type for database operations. | | [EntityMetadataCache](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/EntityMetadataCache) | Caches entity metadata for performance. | | [SqlGenerator](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/Schema/SqlGenerator) | Generates SQL DDL statements from entity metadata. | # TableAttribute Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TableAttribute Specifies the table name for an entity class. If not specified, the class name is used as the table name. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TableAttribute ``` ## Summary Specifies the table name for an entity class. If not specified, the class name is used as the table name. ## Constructors ### .ctor Initializes a new instance of the [TableAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TableAttribute) class. #### Syntax ```csharp theme={"dark"} public TableAttribute(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The table name in the database. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when name is null or whitespace. | ## Properties ### Name Gets the table name in the database. #### Syntax ```csharp theme={"dark"} public string Name { get; } ``` #### Property Value Type: `string` # TursoDatabase Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabase Base class for Turso databases. Inherit from this class and add `TursoDbSet`1` properties for each entity type. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoDatabase ``` ## Summary Base class for Turso databases. Inherit from this class and add `TursoDbSet`1\` properties for each entity type. ## Examples ```csharp theme={"dark"} public class AppDatabase : TursoDatabase { public TursoDbSet<User> Users { get; } public TursoDbSet<Post> Posts { get; } public AppDatabase(IJSRuntime jsRuntime) : base(jsRuntime) { Name = "app.db"; Users = new TursoDbSet<User>(this); Posts = new TursoDbSet<Post>(this); } } ``` ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthToken Gets or sets the authentication token for remote Turso databases. #### Syntax ```csharp theme={"dark"} public string AuthToken { get; set; } ``` #### Property Value Type: `string?` ### AutoCreateSchema Gets or sets whether to automatically create tables on connect. #### Syntax ```csharp theme={"dark"} public bool AutoCreateSchema { get; set; } ``` #### Property Value Type: `bool` ### DbSets Gets the list of DbSets in this database. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DbSets { get; } ``` #### Property Value Type: `System.Collections.Generic.List` ### IsConnected Gets whether the database is currently connected. #### Syntax ```csharp theme={"dark"} public bool IsConnected { get; } ``` #### Property Value Type: `bool` ### Name Gets or sets the database name/identifier. This is used as the connection key in JavaScript. #### Syntax ```csharp theme={"dark"} public string Name { get; init; } ``` #### Property Value Type: `string` ### Url Gets or sets the database URL. Use ":memory:" for in-memory, "file:name.db" for local file, or a Turso cloud URL. #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string` ## Methods ### BeginTransactionAsync Begins a new database transaction. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task BeginTransactionAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A transaction that can be committed or rolled back. #### Examples ```csharp theme={"dark"} await using var transaction = await Database.BeginTransactionAsync(); try { await Database.Users.AddAsync(user); await transaction.CommitAsync(); } catch { await transaction.RollbackAsync(); throw; } ``` ### ConnectAsync Connects to the database. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ConnectAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### DisconnectAsync Disconnects from the database. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DisconnectAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### DisposeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask DisposeAsync() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### EnsureConnectedAsync Ensures the database is connected, connecting if necessary. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task EnsureConnectedAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExecuteAsync Executes a SQL statement and returns the result. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ExecuteAsync(string sql, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL statement to execute. | | `parameters` | `object?[]` | The parameters for the SQL statement. | #### Returns Type: `System.Threading.Tasks.Task` The execution result. ### ExecuteBatchAsync Executes multiple SQL statements in a batch. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> ExecuteBatchAsync(params (string, object[])[] statements) ``` #### Parameters | Name | Type | Description | | - | - | - | | `statements` | `(string, object?[])[]` | The statements to execute. | #### Returns Type: `System.Threading.Tasks.Task>` The results of each statement. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### Prepare Creates a prepared statement for queries that return results. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement Prepare(string sql) where TResult : class, new() ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL query to prepare. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement` A prepared statement that can be executed multiple times. #### Type Parameters * `TResult` - The type of result returned by the query. ### Prepare Creates a prepared statement for non-query commands. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement Prepare(string sql) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL command to prepare. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement` A prepared statement that can be executed multiple times. ### QueryAsync Executes a SQL query and returns all matching rows. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string sql, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL query to execute. | | `parameters` | `object?[]` | The parameters for the SQL query. | #### Returns Type: `System.Threading.Tasks.Task>` A list of results. #### Type Parameters * `T` - The type to deserialize results into. ### QuerySingleAsync Executes a SQL query and returns the first matching row or null. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task QuerySingleAsync(string sql, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL query to execute. | | `parameters` | `object?[]` | The parameters for the SQL query. | #### Returns Type: `System.Threading.Tasks.Task` The first result or default. #### Type Parameters * `T` - The type to deserialize the result into. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IAsyncDisposable # TursoDatabaseOptions Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabaseOptions Configuration options for a Turso database. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoDatabaseOptions ``` ## Summary Configuration options for a Turso database. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TursoDatabaseOptions() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthToken Gets or sets the authentication token for remote Turso databases. #### Syntax ```csharp theme={"dark"} public string AuthToken { get; set; } ``` #### Property Value Type: `string?` ### AutoCreateSchema Gets or sets whether to automatically create tables on connect. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool AutoCreateSchema { get; set; } ``` #### Property Value Type: `bool` ### Url Gets or sets the database URL. Use "file:name.db" for local databases, or a Turso cloud URL for remote. Defaults to ":memory:" for an in-memory database. #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TursoDbException Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDbException Represents an error that occurred during a Turso database operation. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoDbException ``` ## Summary Represents an error that occurred during a Turso database operation. ## Constructors ### .ctor Represents an error that occurred during a Turso database operation. #### Syntax ```csharp theme={"dark"} public TursoDbException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | The error message describing the exception. | # TursoDbSet Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDbSet Represents a collection of entities of a specific type in the database. Provides CRUD operations and querying capabilities. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoDbSet ``` ## Summary Represents a collection of entities of a specific type in the database. Provides CRUD operations and querying capabilities. ## Type Parameters * `TEntity` - The entity type this set manages. ## Constructors ### .ctor Initializes a new instance of the `TursoDbSet`1\` class. #### Syntax ```csharp theme={"dark"} public TursoDbSet(CloudNimble.BlazorEssentials.TursoDb.TursoDatabase database) ``` #### Parameters | Name | Type | Description | | - | - | - | | `database` | `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` | The parent database. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when database is null. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Database Gets the parent database. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.TursoDatabase Database { get; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` ### TableName Gets the table name for this entity type. #### Syntax ```csharp theme={"dark"} public string TableName { get; } ``` #### Property Value Type: `string` ## Methods ### AddAsync Adds a new entity to the table. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AddAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to add. | #### Returns Type: `System.Threading.Tasks.Task` The execution result containing the last insert ID. ### AddRangeAsync Adds multiple entities to the table in a batch. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AddRangeAsync(System.Collections.Generic.IEnumerable entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.IEnumerable` | The entities to add. | #### Returns Type: `System.Threading.Tasks.Task` The number of entities added. ### CountAsync Gets the count of entities in the table. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CountAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` The count of entities. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FindAsync Finds an entity by its primary key. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task FindAsync(object key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `object` | The primary key value. | #### Returns Type: `System.Threading.Tasks.Task` The entity if found, otherwise null. ### FirstOrDefaultAsync Gets the first entity matching the optional filter, or null if none. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task FirstOrDefaultAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` The first entity or null. ### FromSqlAsync Executes a raw SQL query against this entity's table. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> FromSqlAsync(string sql, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL query. | | `parameters` | `object?[]` | The query parameters. | #### Returns Type: `System.Threading.Tasks.Task>` A list of matching entities. ### GetEntityMetadata #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata GetEntityMetadata() ``` #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Schema.EntityMetadata` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OrderBy Creates a query builder with an initial ORDER BY clause (ascending). #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder OrderBy(string column) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column to order by. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` A query builder for fluent query construction. ### OrderByDescending Creates a query builder with an initial ORDER BY clause (descending). #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder OrderByDescending(string column) ``` #### Parameters | Name | Type | Description | | - | - | - | | `column` | `string` | The column to order by. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` A query builder for fluent query construction. ### Query Creates a new query builder for this entity set. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder Query() ``` #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` A query builder for fluent query construction. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveAsync Removes an entity from the table. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task RemoveAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to remove. | #### Returns Type: `System.Threading.Tasks.Task` The execution result. ### RemoveByKeyAsync Removes an entity by its primary key. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task RemoveByKeyAsync(object key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `object` | The primary key value. | #### Returns Type: `System.Threading.Tasks.Task` The execution result. ### RemoveRangeAsync Removes multiple entities from the table. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task RemoveRangeAsync(System.Collections.Generic.IEnumerable entities) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entities` | `System.Collections.Generic.IEnumerable` | The entities to remove. | #### Returns Type: `System.Threading.Tasks.Task` The number of entities removed. ### ToListAsync Retrieves all entities from the table. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> ToListAsync() ``` #### Returns Type: `System.Threading.Tasks.Task>` A list of all entities. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### UpdateAsync Updates an existing entity in the table. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateAsync(TEntity entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entity` | `TEntity` | The entity to update. | #### Returns Type: `System.Threading.Tasks.Task` The execution result. ### Where Creates a query builder with an initial WHERE clause. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder Where(string clause, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `clause` | `string` | The WHERE clause (e.g., "name = ?" or "age > ?"). | | `parameters` | `object?[]` | The parameters for the clause. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.Query.TursoQueryBuilder` A query builder for fluent query construction. ## Related APIs * CloudNimble.BlazorEssentials.TursoDb.ITursoDbSet # TursoPreparedStatement Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoPreparedStatement Represents a prepared SQL statement that can be executed multiple times with different parameters for improved performance. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement ``` ## Summary Represents a prepared SQL statement that can be executed multiple times with different parameters for improved performance. ## Type Parameters * `TResult` - The type of result returned by queries. ## Examples ```csharp theme={"dark"} var statement = Database.Prepare<User>("SELECT * FROM users WHERE age > ?"); var youngUsers = await statement.QueryAsync(18); var olderUsers = await statement.QueryAsync(65); ``` ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Sql Gets the SQL statement. #### Syntax ```csharp theme={"dark"} public string Sql { get; } ``` #### Property Value Type: `string` ### StatementId Gets the unique identifier for this prepared statement. #### Syntax ```csharp theme={"dark"} public string StatementId { get; } ``` #### Property Value Type: `string` ## Methods ### DisposeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask DisposeAsync() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### QueryAsync Executes the prepared statement as a query and returns all matching rows. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `parameters` | `object?[]` | The parameters for the statement. | #### Returns Type: `System.Threading.Tasks.Task>` A list of matching results. ### QuerySingleAsync Executes the prepared statement as a query and returns the first matching row or null. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task QuerySingleAsync(params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `parameters` | `object?[]` | The parameters for the statement. | #### Returns Type: `System.Threading.Tasks.Task` The first matching result or null. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IAsyncDisposable # TursoResult Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoResult Represents the result of a SQL execution operation. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoResult ``` ## Summary Represents the result of a SQL execution operation. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TursoResult() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### LastInsertRowId Gets or sets the row ID of the last inserted row. #### Syntax ```csharp theme={"dark"} public long LastInsertRowId { get; set; } ``` #### Property Value Type: `long` ### RowsAffected Gets or sets the number of rows affected by the operation. #### Syntax ```csharp theme={"dark"} public int RowsAffected { get; set; } ``` #### Property Value Type: `int` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TursoSyncDatabase Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoSyncDatabase Base class for sync-enabled Turso databases. Extends [TursoDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabase) with Tur... ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** CloudNimble.BlazorEssentials.TursoDb.TursoDatabase ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoSyncDatabase ``` ## Summary Base class for sync-enabled Turso databases. Extends [TursoDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabase) with Turso Cloud synchronization capabilities (pull, push, sync). ## Examples ```csharp theme={"dark"} public class AppDatabase : TursoSyncDatabase { public TursoDbSet<User> Users { get; } public AppDatabase(IJSRuntime jsRuntime) : base(jsRuntime) { Name = "app.db"; SyncUrl = "libsql://mydb-myorg.turso.io"; SyncAuthToken = "your-auth-token"; Users = new TursoDbSet<User>(this); } } // Usage await Database.ConnectAsync(); await Database.PullAsync(); // Pull changes from cloud // ... make local changes ... await Database.PushAsync(); // Push local changes to cloud ``` ## Constructors ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Initializes a new instance of the [TursoDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabase) class. #### Syntax ```csharp theme={"dark"} protected TursoDatabase(Microsoft.JSInterop.IJSRuntime jsRuntime) ``` #### Parameters | Name | Type | Description | | - | - | - | | `jsRuntime` | `Microsoft.JSInterop.IJSRuntime` | The JavaScript runtime for interop. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when jsRuntime is null. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthToken Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Gets or sets the authentication token for remote Turso databases. #### Syntax ```csharp theme={"dark"} public string AuthToken { get; set; } ``` #### Property Value Type: `string?` ### AutoCreateSchema Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Gets or sets whether to automatically create tables on connect. #### Syntax ```csharp theme={"dark"} public bool AutoCreateSchema { get; set; } ``` #### Property Value Type: `bool` ### DbSets Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Gets the list of DbSets in this database. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DbSets { get; } ``` #### Property Value Type: `System.Collections.Generic.List` ### EncryptionEnabled Gets or sets whether encryption is enabled for the local database. #### Syntax ```csharp theme={"dark"} public bool EncryptionEnabled { get; set; } ``` #### Property Value Type: `bool` ### EncryptionKey Gets or sets the encryption key for the local database. #### Syntax ```csharp theme={"dark"} public string EncryptionKey { get; set; } ``` #### Property Value Type: `string?` ### IsConnected Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Gets whether the database is currently connected. #### Syntax ```csharp theme={"dark"} public bool IsConnected { get; } ``` #### Property Value Type: `bool` ### IsSyncing Gets whether a sync operation is currently in progress. #### Syntax ```csharp theme={"dark"} public bool IsSyncing { get; } ``` #### Property Value Type: `bool` ### Name Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Gets or sets the database name/identifier. This is used as the connection key in JavaScript. #### Syntax ```csharp theme={"dark"} public string Name { get; init; } ``` #### Property Value Type: `string` ### SyncAuthToken Gets or sets the authentication token for Turso Cloud sync. #### Syntax ```csharp theme={"dark"} public string SyncAuthToken { get; set; } ``` #### Property Value Type: `string` ### SyncIntervalMs Gets or sets the sync interval in milliseconds. Set to 0 to disable automatic periodic sync. Default is 0. #### Syntax ```csharp theme={"dark"} public int SyncIntervalMs { get; set; } ``` #### Property Value Type: `int` ### SyncOnConnect Gets or sets whether to sync on connect. Default is true. #### Syntax ```csharp theme={"dark"} public bool SyncOnConnect { get; set; } ``` #### Property Value Type: `bool` ### SyncUrl Gets or sets the sync URL for Turso Cloud. This is typically in the format: libsql://\[database-name]-\[org-name].turso.io #### Syntax ```csharp theme={"dark"} public string SyncUrl { get; set; } ``` #### Property Value Type: `string` ### Url Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Gets or sets the database URL. Use ":memory:" for in-memory, "file:name.db" for local file, or a Turso cloud URL. #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string` ## Methods ### BeginTransactionAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Begins a new database transaction. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task BeginTransactionAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A transaction that can be committed or rolled back. #### Examples ```csharp theme={"dark"} await using var transaction = await Database.BeginTransactionAsync(); try { await Database.Users.AddAsync(user); await transaction.CommitAsync(); } catch { await transaction.RollbackAsync(); throw; } ``` ### CallJavaScriptAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Calls a JavaScript function in the Turso module. #### Syntax ```csharp theme={"dark"} internal System.Threading.Tasks.Task CallJavaScriptAsync(string functionName, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `functionName` | `string` | - | | `args` | `object?[]` | - | #### Returns Type: `System.Threading.Tasks.Task` ### CallJavaScriptAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Calls a JavaScript function in the Turso module and returns the result. #### Syntax ```csharp theme={"dark"} internal System.Threading.Tasks.Task CallJavaScriptAsync(string functionName, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `functionName` | `string` | - | | `args` | `object?[]` | - | #### Returns Type: `System.Threading.Tasks.Task` ### ConnectAsync Connects to the database with sync support. If [TursoSyncDatabase.SyncOnConnect](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoSyncDatabase#synconconnect) is true, performs an initial sync after connecting. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ConnectAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### ConnectAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Connects to the database. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ConnectAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### DisconnectAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Disconnects from the database. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DisconnectAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### DisposeAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask DisposeAsync() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### EnsureConnectedAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Ensures the database is connected, connecting if necessary. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task EnsureConnectedAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExecuteAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Executes a SQL statement and returns the result. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ExecuteAsync(string sql, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL statement to execute. | | `parameters` | `object?[]` | The parameters for the SQL statement. | #### Returns Type: `System.Threading.Tasks.Task` The execution result. ### ExecuteBatchAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Executes multiple SQL statements in a batch. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> ExecuteBatchAsync(params (string, object[])[] statements) ``` #### Parameters | Name | Type | Description | | - | - | - | | `statements` | `(string, object?[])[]` | The statements to execute. | #### Returns Type: `System.Threading.Tasks.Task>` The results of each statement. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### Prepare Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Creates a prepared statement for queries that return results. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement Prepare(string sql) where TResult : class, new() ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL query to prepare. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement` A prepared statement that can be executed multiple times. #### Type Parameters * `TResult` - The type of result returned by the query. ### Prepare Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Creates a prepared statement for non-query commands. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement Prepare(string sql) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL command to prepare. | #### Returns Type: `CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement` A prepared statement that can be executed multiple times. ### PullAsync Pulls changes from Turso Cloud to the local database. This downloads any changes made on other devices or the cloud. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task PullAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` The sync result containing the number of frames synced. ### PushAsync Pushes local changes to Turso Cloud. This uploads any local changes to the cloud for other devices to sync. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task PushAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` The sync result containing the number of frames synced. ### QueryAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Executes a SQL query and returns all matching rows. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> QueryAsync(string sql, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL query to execute. | | `parameters` | `object?[]` | The parameters for the SQL query. | #### Returns Type: `System.Threading.Tasks.Task>` A list of results. #### Type Parameters * `T` - The type to deserialize results into. ### QuerySingleAsync Inherited Inherited from `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` Executes a SQL query and returns the first matching row or null. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task QuerySingleAsync(string sql, params object[] parameters) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sql` | `string` | The SQL query to execute. | | `parameters` | `object?[]` | The parameters for the SQL query. | #### Returns Type: `System.Threading.Tasks.Task` The first result or default. #### Type Parameters * `T` - The type to deserialize the result into. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SyncAsync Performs a bidirectional sync with Turso Cloud. This combines pull and push operations. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task SyncAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` The sync result containing the number of frames synced. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Events ### SyncCompleted Occurs when a sync operation completes successfully. #### Syntax ```csharp theme={"dark"} public System.EventHandler SyncCompleted ``` ### SyncFailed Occurs when a sync operation fails. #### Syntax ```csharp theme={"dark"} public System.EventHandler SyncFailed ``` ### SyncStarted Occurs when a sync operation starts. #### Syntax ```csharp theme={"dark"} public System.EventHandler SyncStarted ``` ## Related APIs * System.IAsyncDisposable # TursoSyncOptions Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoSyncOptions Configuration options for Turso Cloud sync. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoSyncOptions ``` ## Summary Configuration options for Turso Cloud sync. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TursoSyncOptions() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthToken Gets or sets the authentication token for Turso Cloud. This token is obtained from the Turso CLI or dashboard. #### Syntax ```csharp theme={"dark"} public string AuthToken { get; set; } ``` #### Property Value Type: `string` ### EncryptionEnabled Gets or sets whether to encrypt the local database. Requires an encryption key to be set. #### Syntax ```csharp theme={"dark"} public bool EncryptionEnabled { get; set; } ``` #### Property Value Type: `bool` ### EncryptionKey Gets or sets the encryption key for the local database. Required when EncryptionEnabled is true. #### Syntax ```csharp theme={"dark"} public string EncryptionKey { get; set; } ``` #### Property Value Type: `string?` ### SyncIntervalMs Gets or sets the sync interval in milliseconds. Set to 0 to disable automatic sync. Default is 0 (manual sync only). #### Syntax ```csharp theme={"dark"} public int SyncIntervalMs { get; set; } ``` #### Property Value Type: `int` ### SyncOnConnect Gets or sets whether to automatically sync on connect. Default is true. #### Syntax ```csharp theme={"dark"} public bool SyncOnConnect { get; set; } ``` #### Property Value Type: `bool` ### SyncUrl Gets or sets the sync URL for the Turso Cloud database. This is typically in the format: libsql://\[database-name]-\[org-name].turso.io #### Syntax ```csharp theme={"dark"} public string SyncUrl { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TursoSyncResult Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoSyncResult Represents the result of a sync operation. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoSyncResult ``` ## Summary Represents the result of a sync operation. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TursoSyncResult() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DurationMs Gets or sets the duration of the sync operation in milliseconds. #### Syntax ```csharp theme={"dark"} public long DurationMs { get; set; } ``` #### Property Value Type: `long` ### ErrorMessage Gets or sets an error message if the sync failed. #### Syntax ```csharp theme={"dark"} public string ErrorMessage { get; set; } ``` #### Property Value Type: `string?` ### FramesSynced Gets or sets the number of frames synced. #### Syntax ```csharp theme={"dark"} public int FramesSynced { get; set; } ``` #### Property Value Type: `int` ### Success Gets or sets whether the sync was successful. #### Syntax ```csharp theme={"dark"} public bool Success { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TursoTransaction Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoTransaction Represents a database transaction that can be committed or rolled back. Implements IAsyncDisposable for automatic rollback if not committed. ## Definition **Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll **Namespace:** CloudNimble.BlazorEssentials.TursoDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.TursoDb.TursoTransaction ``` ## Summary Represents a database transaction that can be committed or rolled back. Implements IAsyncDisposable for automatic rollback if not committed. ## Examples ```csharp theme={"dark"} await using var transaction = await Database.BeginTransactionAsync(); try { await Database.Users.AddAsync(user); await Database.Posts.AddAsync(post); await transaction.CommitAsync(); } catch { await transaction.RollbackAsync(); throw; } ``` ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Database Gets the database this transaction belongs to. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.TursoDb.TursoDatabase Database { get; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.TursoDb.TursoDatabase` ### IsCompleted Gets whether the transaction has been completed (committed or rolled back). #### Syntax ```csharp theme={"dark"} public bool IsCompleted { get; } ``` #### Property Value Type: `bool` ## Methods ### CommitAsync Commits the transaction, making all changes permanent. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CommitAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown if the transaction is already completed. | ### DisposeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask DisposeAsync() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RollbackAsync Rolls back the transaction, discarding all changes. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task RollbackAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown if the transaction is already completed. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IAsyncDisposable # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/index Summary of the CloudNimble.BlazorEssentials.TursoDb Namespace ## Types ### Classes | Name | Summary | | - | - | | [ColumnAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/ColumnAttribute) | Specifies the column name and optional type for a property. If not specified, the property name is used as the column name. | | [IndexAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/IndexAttribute) | Creates an index on the specified column. | | [NotMappedAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/NotMappedAttribute) | Excludes a property from database mapping. Properties marked with this attribute will not be included in table creation or CRUD operations. | | [PrimaryKeyAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/PrimaryKeyAttribute) | Marks a property as the primary key of the table. | | [TableAttribute](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TableAttribute) | Specifies the table name for an entity class. If not specified, the class name is used as the table name. | | [TursoDbException](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDbException) | Represents an error that occurred during a Turso database operation. | | [TursoDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabase) | Base class for Turso databases. Inherit from this class and add `TursoDbSet`1\` properties for each entity type. | | [TursoDatabaseOptions](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabaseOptions) | Configuration options for a Turso database. | | [TursoDbSet](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDbSet) | Represents a collection of entities of a specific type in the database. Provides CRUD operations and querying capabilities. | | [TursoPreparedStatement](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoPreparedStatement) | Represents a prepared SQL statement for executing non-query commands. | | [TursoPreparedStatement](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoPreparedStatement) | Represents a prepared SQL statement that can be executed multiple times with different parameters for improved performance. | | [TursoResult](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoResult) | Represents the result of a SQL execution operation. | | [TursoSyncDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoSyncDatabase) | Base class for sync-enabled Turso databases. Extends [TursoDatabase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoDatabase) with Turso Cloud synchronization capabilities (pull, push, sync). | | [TursoSyncOptions](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoSyncOptions) | Configuration options for Turso Cloud sync. | | [TursoSyncResult](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoSyncResult) | Represents the result of a sync operation. | | [TursoTransaction](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/TursoTransaction) | Represents a database transaction that can be committed or rolled back. Implements IAsyncDisposable for automatic rollback if not committed. | ### Interfaces | Name | Summary | | - | - | | [ITursoDbSet](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/TursoDb/ITursoDbSet) | Interface for TursoDbSet, used for database discovery. | # ViewModelBase Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/ViewModelBase A base class for your Blazor MVVM implementation that gives you access to all the useful stuff Blazor and BlazorEssentials inject into the app. ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** CloudNimble.BlazorEssentials.BlazorObservable ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials.ViewModelBase ``` ## Summary A base class for your Blazor MVVM implementation that gives you access to all the useful stuff Blazor and BlazorEssentials inject into the app. ## Type Parameters * `TAppState` - * `TConfig` - ## Constructors ### .ctor Creates a new instance of the `ViewModelBase`2\`. #### Syntax ```csharp theme={"dark"} public ViewModelBase(System.Net.Http.IHttpClientFactory httpClientFactory, TConfig configuration = default(TConfig), TAppState appState = null, CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | The [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) instance injected from the DI container. | | `configuration` | `TConfig` | The *TConfig* instance injected from the DI container. | | `appState` | `TAppState` | The *TAppState* instance injected from the DI container. | | `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - | ### .ctor Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Creates a new instance of the [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) class. #### Syntax ```csharp theme={"dark"} public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - | ## Properties ### AppState The injected [AppStateBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase) instance for the ViewModel. #### Syntax ```csharp theme={"dark"} public TAppState AppState { get; internal set; } ``` #### Property Value Type: `TAppState` ### Configuration The injected `ConfigurationBase` instance for the ViewModel. #### Syntax ```csharp theme={"dark"} public TConfig Configuration { get; internal set; } ``` #### Property Value Type: `TConfig` ### DelayDispatcher #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.Threading.DelayDispatcher DelayDispatcher { get; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.Threading.DelayDispatcher` #### Remarks This property is structured so that a new instance is not created unless specifically asked, to avoid unnecessary memory allocations. ### FilterCriteria Allows you to set any additional filtering criteria for this ViewModels' HTTP requests from inside the Page itself. #### Syntax ```csharp theme={"dark"} public string FilterCriteria { get; set; } ``` #### Property Value Type: `string` ### HttpClientFactory The injected [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) instance for the ViewModel. #### Syntax ```csharp theme={"dark"} public System.Net.Http.IHttpClientFactory HttpClientFactory { get; internal set; } ``` #### Property Value Type: `System.Net.Http.IHttpClientFactory` ### LoadingStatus Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` A [BlazorObservable.LoadingStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable#loadingstatus) specifying the current state of the required data for this Observable. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.LoadingStatus` ### StateHasChanged Inherited Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` Determines how to trigger StateHasChanged events in a Blazor component. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig` ## Methods ### Dispose Override Inherited from `CloudNimble.BlazorEssentials.BlazorObservable` #### Syntax ```csharp theme={"dark"} protected override void Dispose(bool disposing) ``` #### Parameters | Name | Type | Description | | - | - | - | | `disposing` | `bool` | - | # _Imports Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/_Imports ## Definition **Assembly:** CloudNimble.BlazorEssentials.dll **Namespace:** CloudNimble.BlazorEssentials **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.BlazorEssentials._Imports ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public _Imports() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/blazoressentials/api-reference/CloudNimble/BlazorEssentials/index Summary of the CloudNimble.BlazorEssentials Namespace ## Types ### Classes | Name | Summary | | - | - | | [AppStateBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase) | A base class to control application-wide state in a Blazor app. | | [BlazorObservable](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable) | A base class for Blazor ViewModels to implement [INotifyPropertyChanged](https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged) and [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable). | | [Html](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Html) | A port of the ASP.NET MVC HtmlHelper class to Blazor. | | [InterfaceElement](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement) | Represents the basic parts of any HTML element. | | [JsModule](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/JsModule) | A wrapper that makes it easier to dynamically import JavaScript modules in Blazor. Can be used as the foundation to build strongly-typed .NET wrappers around JavaScript libraries. | | [LoadingStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus) | Outlines the different phases of the loading cycle. | | [StateHasChangedConfig](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedConfig) | | | [StateHasChangedDebugMode](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDebugMode) | Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. | | [StateHasChangedDelayMode](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDelayMode) | Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. | | [ViewModelBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/ViewModelBase) | A base class for your Blazor MVVM implementation that gives you access to all the useful stuff Blazor and BlazorEssentials inject into the app. | | [\_Imports](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/_Imports) | | ### Enums | Name | Summary | | - | - | | [LoadingStatus](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/LoadingStatus) | Outlines the different phases of the loading cycle. | | [StateHasChangedDebugMode](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDebugMode) | Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. | | [StateHasChangedDelayMode](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/StateHasChangedDelayMode) | Defines how BlazorObservables are monitored to reduce the number of times StateHasChanged is fired. | # IApplicationBuilder Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/AspNetCore/Builder/IApplicationBuilder Extension methods for IApplicationBuilder from Microsoft.AspNetCore.Http.Abstractions ## Definition **Assembly:** Microsoft.AspNetCore.Http.Abstractions.dll **Namespace:** Microsoft.AspNetCore.Builder ## Syntax ```csharp theme={"dark"} Microsoft.AspNetCore.Builder.IApplicationBuilder ``` ## Summary This type is defined in Microsoft.AspNetCore.Http.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder) for more information about the rest of the API. ## Methods ### UseCrossOriginIsolation Extension Extension method from `Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions` Adds Cross-Origin Isolation middleware to the application pipeline. This enables SharedArrayBuffer and high-resolution timers required by WASM libraries. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseCrossOriginIsolation(Microsoft.AspNetCore.Builder.IApplicationBuilder app) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `Microsoft.AspNetCore.Builder.IApplicationBuilder` | The application builder. | #### Returns Type: `Microsoft.AspNetCore.Builder.IApplicationBuilder` The application builder for chaining. #### Examples ```csharp theme={"dark"} // In Program.cs var app = builder.Build(); app.UseCrossOriginIsolation(); ``` #### Remarks This middleware adds the following headers to responses: * `Cross-Origin-Opener-Policy: same-origin` * `Cross-Origin-Embedder-Policy: require-corp` * `Cross-Origin-Resource-Policy: same-origin` \Warning:\ This may break third-party scripts and iframes. Use [CrossOriginIsolationOptions})](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.applicationbuilderextensions.usecrossoriginisolation\(microsoft.aspnetcore.builder.iapplicationbuilder,system.action\{cloudnimble.blazoressentials.server.middleware.crossoriginisolationoptions}\)) to configure exclusions. ### UseCrossOriginIsolation Extension Extension method from `Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions` Adds Cross-Origin Isolation middleware to the application pipeline with custom options. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseCrossOriginIsolation(Microsoft.AspNetCore.Builder.IApplicationBuilder app, System.Action configureOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `Microsoft.AspNetCore.Builder.IApplicationBuilder` | The application builder. | | `configureOptions` | `System.Action` | Action to configure the middleware options. | #### Returns Type: `Microsoft.AspNetCore.Builder.IApplicationBuilder` The application builder for chaining. #### Examples ```csharp theme={"dark"} // In Program.cs var app = builder.Build(); app.UseCrossOriginIsolation(options => { // Use credentialless instead of require-corp for less strict isolation options.CoepPolicy = "credentialless"; // Exclude API paths from cross-origin isolation options.ExcludePaths.Add("/api/"); // Exclude external resource paths options.ExcludePaths.Add("/external/"); }); ``` ### UseCrossOriginIsolation Extension Extension method from `Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions` Adds Cross-Origin Isolation middleware to the application pipeline with the specified options. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseCrossOriginIsolation(Microsoft.AspNetCore.Builder.IApplicationBuilder app, CloudNimble.BlazorEssentials.Server.Middleware.CrossOriginIsolationOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `Microsoft.AspNetCore.Builder.IApplicationBuilder` | The application builder. | | `options` | `CloudNimble.BlazorEssentials.Server.Middleware.CrossOriginIsolationOptions` | The middleware options. | #### Returns Type: `Microsoft.AspNetCore.Builder.IApplicationBuilder` The application builder for chaining. # Overview Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/AspNetCore/Builder/index Summary of the Microsoft.AspNetCore.Builder Namespace ## Types # EditContext Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/AspNetCore/Components/Forms/EditContext Extension methods for EditContext from Microsoft.AspNetCore.Components.Forms ## Definition **Assembly:** Microsoft.AspNetCore.Components.Forms.dll **Namespace:** Microsoft.AspNetCore.Components.Forms ## Syntax ```csharp theme={"dark"} Microsoft.AspNetCore.Components.Forms.EditContext ``` ## Summary This type is defined in Microsoft.AspNetCore.Components.Forms. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.forms.editcontext) for more information about the rest of the API. ## Methods ### NotifyFieldChanged Extension Extension method from `Microsoft.AspNetCore.Components.Forms.EditContextExtensions` #### Syntax ```csharp theme={"dark"} public static void NotifyFieldChanged(Microsoft.AspNetCore.Components.Forms.EditContext editContext, string field) ``` #### Parameters | Name | Type | Description | | - | - | - | | `editContext` | `Microsoft.AspNetCore.Components.Forms.EditContext` | - | | `field` | `string` | The field name that was changed in the process, typically specified using "nameof(YourObject.YourProperty"). | ### NotifyFieldsChanged Extension Extension method from `Microsoft.AspNetCore.Components.Forms.EditContextExtensions` #### Syntax ```csharp theme={"dark"} public static void NotifyFieldsChanged(Microsoft.AspNetCore.Components.Forms.EditContext editContext, params string[] fields) ``` #### Parameters | Name | Type | Description | | - | - | - | | `editContext` | `Microsoft.AspNetCore.Components.Forms.EditContext` | - | | `fields` | `string[]` | An inline list of fields that were changed in the process, typically specified using "nameof(YourObject.YourProperty"). | # Overview Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/AspNetCore/Components/Forms/index Summary of the Microsoft.AspNetCore.Components.Forms Namespace ## Types # WebAssemblyHostBuilder Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/WebAssemblyHostBuilder Extension methods for WebAssemblyHostBuilder from Microsoft.AspNetCore.Components.WebAssembly ## Definition **Assembly:** Microsoft.AspNetCore.Components.WebAssembly.dll **Namespace:** Microsoft.AspNetCore.Components.WebAssembly.Hosting ## Syntax ```csharp theme={"dark"} Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder ``` ## Summary This type is defined in Microsoft.AspNetCore.Components.WebAssembly. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.webassembly.hosting.webassemblyhostbuilder) for more information about the rest of the API. ## Methods ### AddBlazorEssentials Extension Extension method from `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilderExtensions` Registers the necessary services to bootstrap BlazorEssentials, including a `ConfigurationBase`, [AppStateBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase), and [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)HttpClients\ for interacting with both the #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder AddBlazorEssentials(Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder builder, string configSectionName) where TConfiguration : CloudNimble.EasyAF.Configuration.ConfigurationBase where TAppState : CloudNimble.BlazorEssentials.AppStateBase ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder` | The [WebAssemblyHostBuilder](/blazoressentials/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/WebAssemblyHostBuilder) instance to configure. | | `configSectionName` | `string` | The name of the Configuration node in appsettings.json that specifies BlazorEssentials settings. | #### Returns Type: `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder` The #### Type Parameters * `TConfiguration` - The `ConfigurationBase`-derived type to register in the DI container. * `TAppState` - The [AppStateBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase)-derived type to register in the DI container. ### AddBlazorEssentials Extension Extension method from `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder AddBlazorEssentials(Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder builder, string configSectionName) where TConfiguration : CloudNimble.EasyAF.Configuration.ConfigurationBase where TAppState : CloudNimble.BlazorEssentials.AppStateBase where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder` | The [WebAssemblyHostBuilder](/blazoressentials/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/WebAssemblyHostBuilder) instance to configure. | | `configSectionName` | `string` | The name of the Configuration node in appsettings.json that specifies BlazorEssentials settings. | #### Returns Type: `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder` #### Type Parameters * `TConfiguration` - The `ConfigurationBase`-derived type to register in the DI container. * `TAppState` - The [AppStateBase](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase)-derived type to register in the DI container. * `TMessageHandler` - The [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler)-derived type to register for the built-in HttpClients. Defaults to `BlazorEssentialsAuthorizationMessageHandler`1\`. #### Remarks If your *TMessageHandler* needs a constructor, register it before making this call. # Overview Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/index Summary of the Microsoft.AspNetCore.Components.WebAssembly.Hosting Namespace ## Types # IHostBuilder Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/Extensions/Hosting/IHostBuilder Extension methods for IHostBuilder from Microsoft.Extensions.Hosting.Abstractions ## Definition **Assembly:** Microsoft.Extensions.Hosting.Abstractions.dll **Namespace:** Microsoft.Extensions.Hosting ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.Hosting.IHostBuilder ``` ## Summary This type is defined in Microsoft.Extensions.Hosting.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostbuilder) for more information about the rest of the API. ## Methods ### AddBlazorEssentials Extension Extension method from `Microsoft.Extensions.Hosting.IHostBuilderExtensions` Adds Blazor capabilities to the provided [IHostBuilder](/blazoressentials/api-reference/Microsoft/Extensions/Hosting/IHostBuilder). #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder AddBlazorEssentials(Microsoft.Extensions.Hosting.IHostBuilder builder, string configSectionName) where TConfiguration : CloudNimble.EasyAF.Configuration.ConfigurationBase where TAppState : CloudNimble.BlazorEssentials.AppStateBase where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | - | | `configSectionName` | `string` | - | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` #### Type Parameters * `TConfiguration` - * `TAppState` - * `TMessageHandler` - ### AddBlazorEssentials Extension Extension method from `Microsoft.Extensions.Hosting.IHostBuilderExtensions` Adds Blazor capabilities to the provided [IHostBuilder](/blazoressentials/api-reference/Microsoft/Extensions/Hosting/IHostBuilder). #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder AddBlazorEssentials(Microsoft.Extensions.Hosting.IHostBuilder builder, string configSectionName, CloudNimble.EasyAF.Core.HttpHandlerMode httpHandlerMode) where TConfiguration : CloudNimble.EasyAF.Configuration.ConfigurationBase where TAppState : CloudNimble.BlazorEssentials.AppStateBase where TMessageHandler : System.Net.Http.DelegatingHandler ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | - | | `configSectionName` | `string` | - | | `httpHandlerMode` | `CloudNimble.EasyAF.Core.HttpHandlerMode` | - | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` #### Type Parameters * `TConfiguration` - * `TAppState` - * `TMessageHandler` - # Overview Source: https://easyaf.dev/blazoressentials/api-reference/Microsoft/Extensions/Hosting/index Summary of the Microsoft.Extensions.Hosting Namespace ## Types # IEnumerable Source: https://easyaf.dev/blazoressentials/api-reference/System/Collections/Generic/IEnumerable Extension methods for IEnumerable from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System.Collections.Generic ## Syntax ```csharp theme={"dark"} System.Collections.Generic.IEnumerable ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable\{t}) for more information about the rest of the API. ## Methods ### Traverse Extension Extension method from `CloudNimble.BlazorEssentials.Extensions.ListExtensions` Return item and all children recursively. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable Traverse(System.Collections.Generic.IEnumerable items, System.Func> childSelector) ``` #### Parameters | Name | Type | Description | | - | - | - | | `items` | `System.Collections.Generic.IEnumerable` | - | | `childSelector` | `System.Func>` | - | #### Returns Type: `System.Collections.Generic.IEnumerable` #### Type Parameters * `T` - #### Remarks [https://stackoverflow.com/a/32655815/403765](https://stackoverflow.com/a/32655815/403765) # Overview Source: https://easyaf.dev/blazoressentials/api-reference/System/Collections/Generic/index Summary of the System.Collections.Generic Namespace ## Types # Client-Side Databases Source: https://easyaf.dev/blazoressentials/guides/databases/index Store data locally in the browser with IndexedDB or TursoDb BlazorEssentials provides two client-side database options for Blazor WebAssembly applications, enabling offline-capable, local-first experiences. NoSQL key-value storage using the browser's built-in IndexedDB API. Great for caching, offline data, and simple object storage. Full SQLite database with SQL queries, transactions, and optional Turso Cloud sync for multi-device experiences. ## Choosing a Database | Feature | IndexedDB | TursoDb | | - | - | - | | Data Model | Key-value / Document | Relational (SQL) | | Query Language | JavaScript API | SQL | | Relationships | Manual | Foreign keys | | Transactions | Yes | Yes | | Cloud Sync | No | Yes (Turso Cloud) | | Browser Support | All modern browsers | Requires SharedArrayBuffer | | Schema | Dynamic | Defined with attributes | Use **IndexedDB** for simple caching and document storage. Use **TursoDb** when you need SQL queries, relationships, or cloud synchronization. # IndexedDB Source: https://easyaf.dev/blazoressentials/guides/databases/indexeddb NoSQL key-value storage for Blazor WebAssembly applications IndexedDB provides a powerful NoSQL database API built into every modern browser. BlazorEssentials.IndexedDb makes it easy to use from your Blazor WebAssembly applications with a strongly-typed C# API. Uses the browser's built-in IndexedDB - no server or external dependencies. Data persists locally, enabling full offline functionality. Object stores are strongly typed with compile-time safety. Create indexes for fast lookups on any property. ## Installation ```bash theme={"dark"} dotnet add package BlazorEssentials.IndexedDb ``` ## Quick Start ### Define Your Entities Use attributes to configure how entities are stored: ```csharp Models/TodoItem.cs theme={"dark"} using CloudNimble.BlazorEssentials.IndexedDb; [ObjectStore("todos")] public class TodoItem { public int Id { get; set; } public string Title { get; set; } = ""; public bool IsCompleted { get; set; } [Index] public DateTime CreatedAt { get; set; } = DateTime.UtcNow; } ``` ### Create Your Database Inherit from `IndexedDbDatabase` and add `IndexedDbObjectStore` properties: ```csharp Data/AppDatabase.cs theme={"dark"} using CloudNimble.BlazorEssentials.IndexedDb; using Microsoft.JSInterop; public class AppDatabase : IndexedDbDatabase { public IndexedDbObjectStore Todos { get; set; } public AppDatabase(IJSRuntime jsRuntime) : base(jsRuntime) { Name = "MyAppDb"; Version = 1; } } ``` ### Register and Use ```csharp Program.cs theme={"dark"} builder.Services.AddScoped(); ``` ```razor MyComponent.razor theme={"dark"} @inject AppDatabase Database @code { private List todos = new(); protected override async Task OnInitializedAsync() { await Database.OpenAsync(); todos = await Database.Todos.GetAllAsync(); } } ``` ## CRUD Operations ### Create ```csharp theme={"dark"} var todo = new TodoItem { Id = 1, Title = "Learn Blazor", IsCompleted = false }; await Database.Todos.AddAsync(todo); ``` ### Read ```csharp Get All theme={"dark"} var allTodos = await Database.Todos.GetAllAsync(); ``` ```csharp Get by Key theme={"dark"} var todo = await Database.Todos.GetAsync(1); ``` ```csharp Get by Index theme={"dark"} var recentTodos = await Database.Todos .GetByIndexAsync("CreatedAt", KeyRange.LowerBound(DateTime.Today)); ``` ### Update ```csharp theme={"dark"} var todo = await Database.Todos.GetAsync(1); todo.IsCompleted = true; await Database.Todos.PutAsync(todo); ``` ### Delete ```csharp Delete by Key theme={"dark"} await Database.Todos.DeleteAsync(1); ``` ```csharp Clear All theme={"dark"} await Database.Todos.ClearAsync(); ``` ## Indexes Create indexes for fast lookups on frequently queried properties: ```csharp theme={"dark"} [ObjectStore("users")] public class User { public int Id { get; set; } [Index] public string Email { get; set; } = ""; [Index(Unique = false)] public string Department { get; set; } = ""; } ``` Query using indexes: ```csharp theme={"dark"} // Find user by email var user = await Database.Users .GetByIndexAsync("Email", "john@example.com") .FirstOrDefaultAsync(); // Find all users in a department var engineers = await Database.Users .GetByIndexAsync("Department", "Engineering"); ``` ## Key Ranges Use `KeyRange` for range queries on indexed properties: ```csharp theme={"dark"} // Items created today var todayItems = await Database.Todos .GetByIndexAsync("CreatedAt", KeyRange.LowerBound(DateTime.Today)); // Items in a date range var rangeItems = await Database.Todos .GetByIndexAsync("CreatedAt", KeyRange.Bound(startDate, endDate)); ``` ## Best Practices Choose key paths that uniquely identify your entities. Auto-incrementing integers or GUIDs work well for most cases. Only create indexes on properties you'll query frequently. Each index adds storage overhead and slows down writes. When changing your schema, increment the `Version` property. IndexedDB will trigger an upgrade event to migrate existing data. ## API Reference Base class for IndexedDB databases Typed object store for CRUD operations Range queries for indexed lookups Define indexes on properties # TursoDb Source: https://easyaf.dev/blazoressentials/guides/databases/tursodb Build local-first Blazor applications with SQLite and optional Turso Cloud sync TursoDb provides a powerful, type-safe wrapper around [libSQL](https://turso.tech/libsql) for Blazor WebAssembly applications. It enables local-first development with SQLite stored in the browser, with optional synchronization to [Turso Cloud](https://turso.tech/). Data is stored locally in the browser using SQLite, ensuring your app works offline. Optionally sync with Turso Cloud for multi-device and real-time collaboration. Entity attributes and strongly-typed DbSets provide compile-time safety. Tables and indexes are automatically created from your entity definitions. ## Installation ```bash theme={"dark"} dotnet add package BlazorEssentials.TursoDb ``` TursoDb requires Cross-Origin Isolation headers for SharedArrayBuffer support. ```bash theme={"dark"} dotnet add package BlazorEssentials.Server ``` Add the Cross-Origin Isolation middleware to your server's `Program.cs`: ```csharp Program.cs theme={"dark"} var app = builder.Build(); // Add before other middleware app.UseCrossOriginIsolation(); app.UseBlazorFrameworkFiles(); app.UseStaticFiles(); // ... rest of your middleware ``` Cross-Origin Isolation may break third-party scripts, iframes, and CDN resources that aren't configured for isolated contexts. Test thoroughly before deploying. ## Quick Start ### Define Your Entities Use attributes to define how your C# classes map to SQLite tables: ```csharp Models/User.cs theme={"dark"} using CloudNimble.BlazorEssentials.TursoDb; [Table("users")] public class User { [PrimaryKey(AutoIncrement = true)] public long Id { get; set; } [Column("name")] public string Name { get; set; } = ""; [Column("email")] [Index(Unique = true)] public string Email { get; set; } = ""; [Column("age")] public int Age { get; set; } [Column("is_active")] public bool IsActive { get; set; } = true; [Column("created_at")] public DateTime CreatedAt { get; set; } = DateTime.UtcNow; } ``` Use `[NotMapped]` on properties you don't want persisted to the database. ### Create Your Database Inherit from `TursoDatabase` and add `TursoDbSet` properties for each entity: ```csharp Data/AppDatabase.cs theme={"dark"} using CloudNimble.BlazorEssentials.TursoDb; using Microsoft.JSInterop; public class AppDatabase : TursoDatabase { public TursoDbSet Users { get; } public TursoDbSet Posts { get; } public AppDatabase(IJSRuntime jsRuntime) : base(jsRuntime) { Name = "myapp.db"; Users = new TursoDbSet(this); Posts = new TursoDbSet(this); } } ``` ### Register and Use ```csharp Program.cs theme={"dark"} builder.Services.AddScoped(); ``` ```csharp MyComponent.razor theme={"dark"} @inject AppDatabase Database @code { protected override async Task OnInitializedAsync() { await Database.ConnectAsync(); var users = await Database.Users.ToListAsync(); } } ``` ## Entity Attributes Maps a class to a specific table name in SQLite. ```csharp theme={"dark"} [Table("users")] public class User { } ``` If omitted, the class name is used as the table name. Marks a property as the primary key. Use `AutoIncrement = true` for auto-generated IDs. ```csharp theme={"dark"} [PrimaryKey(AutoIncrement = true)] public long Id { get; set; } ``` Maps a property to a specific column name. Use snake\_case for SQLite conventions. ```csharp theme={"dark"} [Column("created_at")] public DateTime CreatedAt { get; set; } ``` Creates an index on the column for faster queries. Use `Unique = true` for unique constraints. ```csharp theme={"dark"} [Column("email")] [Index(Unique = true)] public string Email { get; set; } ``` Excludes a property from database persistence. ```csharp theme={"dark"} [NotMapped] public string FullName => $"{FirstName} {LastName}"; ``` ## CRUD Operations ### Create ```csharp theme={"dark"} var user = new User { Name = "John Doe", Email = "john@example.com", Age = 30 }; await Database.Users.AddAsync(user); // user.Id is now populated with the auto-generated ID ``` ### Read ```csharp Get All theme={"dark"} var allUsers = await Database.Users.ToListAsync(); ``` ```csharp Find by ID theme={"dark"} var user = await Database.Users.FindAsync(1); ``` ```csharp Count theme={"dark"} var count = await Database.Users.CountAsync(); ``` ### Update ```csharp theme={"dark"} var user = await Database.Users.FindAsync(1); user.Name = "Jane Doe"; user.Age = 31; await Database.Users.UpdateAsync(user); ``` ### Delete ```csharp Delete Entity theme={"dark"} var user = await Database.Users.FindAsync(1); await Database.Users.RemoveAsync(user); ``` ```csharp Delete by ID theme={"dark"} await Database.Users.RemoveByKeyAsync(1); ``` ## Query Builder Build complex queries with the fluent query API: ```csharp theme={"dark"} var activeAdults = await Database.Users .Where("age >= ? AND is_active = ?", 18, true) .OrderBy("name") .Take(10) .ToListAsync(); ``` ### Available Methods | Method | Description | | - | - | | `Where(clause, params)` | Filter results with a SQL WHERE clause | | `OrderBy(column)` | Sort ascending by column | | `OrderByDescending(column)` | Sort descending by column | | `Take(count)` | Limit results to count | | `Skip(count)` | Skip first count results | | `ToListAsync()` | Execute and return all results | | `FirstOrDefaultAsync()` | Execute and return first result or null | | `CountAsync()` | Return count of matching results | Use `?` placeholders for parameters to prevent SQL injection. Parameters are passed in order after the SQL clause. ## Transactions Use transactions for atomic operations that should succeed or fail together: ```csharp theme={"dark"} await using var transaction = await Database.BeginTransactionAsync(); try { await Database.Users.AddAsync(new User { Name = "User 1" }); await Database.Users.AddAsync(new User { Name = "User 2" }); await transaction.CommitAsync(); } catch { await transaction.RollbackAsync(); throw; } ``` If you dispose the transaction without calling `CommitAsync()`, it automatically rolls back. ## Prepared Statements For frequently executed queries, use prepared statements for better performance: ```csharp Query Statement theme={"dark"} var statement = Database.Prepare("SELECT * FROM users WHERE age > ?"); var youngUsers = await statement.QueryAsync(18); var olderUsers = await statement.QueryAsync(65); await statement.DisposeAsync(); ``` ```csharp Execute Statement theme={"dark"} var statement = Database.Prepare("UPDATE users SET is_active = ? WHERE age < ?"); await statement.ExecuteAsync(false, 13); await statement.ExecuteAsync(true, 18); await statement.DisposeAsync(); ``` ## Raw SQL Execute raw SQL when you need full control: ```csharp Execute (INSERT/UPDATE/DELETE) theme={"dark"} var result = await Database.ExecuteAsync( "INSERT INTO users (name, email) VALUES (?, ?)", "John", "john@example.com" ); Console.WriteLine($"Rows affected: {result.RowsAffected}"); Console.WriteLine($"Last insert ID: {result.LastInsertRowId}"); ``` ```csharp Query (SELECT) theme={"dark"} var users = await Database.QueryAsync( "SELECT * FROM users WHERE email LIKE ?", "%@example.com" ); ``` ```csharp Batch Execute theme={"dark"} var results = await Database.ExecuteBatchAsync( ("INSERT INTO users (name) VALUES (?)", new object[] { "User 1" }), ("INSERT INTO users (name) VALUES (?)", new object[] { "User 2" }), ("INSERT INTO users (name) VALUES (?)", new object[] { "User 3" }) ); ``` ## Turso Cloud Sync For multi-device sync and cloud backup, use `TursoSyncDatabase`: ### Setup ```csharp Data/SyncedAppDatabase.cs theme={"dark"} using CloudNimble.BlazorEssentials.TursoDb; using Microsoft.JSInterop; public class SyncedAppDatabase : TursoSyncDatabase { public TursoDbSet Users { get; } public SyncedAppDatabase(IJSRuntime jsRuntime) : base(jsRuntime) { Name = "myapp.db"; SyncUrl = "libsql://mydb-myorg.turso.io"; SyncAuthToken = "your-auth-token"; Users = new TursoDbSet(this); } } ``` Never hardcode auth tokens in production code. Use configuration or secure storage. ### Sync Operations ```csharp Pull from Cloud theme={"dark"} // Download changes from Turso Cloud var result = await Database.PullAsync(); Console.WriteLine($"Synced {result.FramesSynced} frames in {result.DurationMs}ms"); ``` ```csharp Push to Cloud theme={"dark"} // Upload local changes to Turso Cloud var result = await Database.PushAsync(); ``` ```csharp Bidirectional Sync theme={"dark"} // Pull then push in one operation var result = await Database.SyncAsync(); ``` ### Sync Events Subscribe to sync lifecycle events: ```csharp theme={"dark"} Database.SyncStarted += (sender, e) => { Console.WriteLine("Sync started..."); }; Database.SyncCompleted += (sender, result) => { Console.WriteLine($"Sync completed: {result.FramesSynced} frames"); }; Database.SyncFailed += (sender, ex) => { Console.WriteLine($"Sync failed: {ex.Message}"); }; ``` ### Sync Options | Property | Description | Default | | - | - | - | | `SyncUrl` | Turso Cloud database URL | Required | | `SyncAuthToken` | Authentication token | Required | | `SyncOnConnect` | Sync automatically on connect | `true` | | `SyncIntervalMs` | Auto-sync interval (0 = disabled) | `0` | | `EncryptionEnabled` | Enable local database encryption | `false` | | `EncryptionKey` | Encryption key for local database | `null` | ## Cross-Origin Isolation TursoDb requires Cross-Origin Isolation headers for SharedArrayBuffer support. The `BlazorEssentials.Server` package provides middleware to add these headers. ### Basic Configuration ```csharp theme={"dark"} app.UseCrossOriginIsolation(); ``` ### Advanced Configuration ```csharp theme={"dark"} app.UseCrossOriginIsolation(options => { // Use less strict policy for better compatibility options.CoepPolicy = "credentialless"; // Exclude paths that need third-party resources options.ExcludePaths.Add("/api/"); options.ExcludePaths.Add("/external/"); // Disable CORP header if causing issues options.IncludeCorpHeader = false; }); ``` ### Headers Added | Header | Value | Purpose | | - | - | - | | `Cross-Origin-Opener-Policy` | `same-origin` | Isolates browsing context | | `Cross-Origin-Embedder-Policy` | `require-corp` | Requires resources to grant permission | | `Cross-Origin-Resource-Policy` | `same-origin` | Controls resource sharing | ## Type Mapping TursoDb automatically maps C# types to SQLite types: | C# Type | SQLite Type | | - | - | | `int`, `long`, `short`, `byte` | `INTEGER` | | `float`, `double`, `decimal` | `REAL` | | `string` | `TEXT` | | `bool` | `INTEGER` (0/1) | | `DateTime`, `DateTimeOffset` | `TEXT` (ISO 8601) | | `Guid` | `TEXT` | | `byte[]` | `BLOB` | ## Best Practices Register your database as a scoped service for proper lifecycle management: ```csharp theme={"dark"} builder.Services.AddScoped(); ``` Connect to the database early in your app lifecycle, such as in `App.razor` or a layout component: ```csharp theme={"dark"} protected override async Task OnInitializedAsync() { await Database.ConnectAsync(); } ``` Wrap related operations in transactions to ensure data consistency: ```csharp theme={"dark"} await using var tx = await Database.BeginTransactionAsync(); // ... operations ... await tx.CommitAsync(); ``` When using cloud sync, implement conflict resolution strategies for your use case. Consider using timestamps or version numbers to detect conflicts. ## Troubleshooting This error indicates Cross-Origin Isolation is not configured. Ensure: 1. `BlazorEssentials.Server` is installed 2. `app.UseCrossOriginIsolation()` is called before other middleware 3. Headers are not being stripped by a proxy or CDN Cross-Origin Isolation may break external scripts. Options: 1. Use `options.CoepPolicy = "credentialless"` for less strict isolation 2. Add script paths to `options.ExcludePaths` 3. Ensure external resources have `Cross-Origin-Resource-Policy` headers Verify your Turso Cloud credentials: 1. Check `SyncUrl` format: `libsql://[db-name]-[org].turso.io` 2. Ensure `SyncAuthToken` is valid and not expired 3. Verify the database exists in your Turso dashboard ## API Reference Base class for local databases Sync-enabled database with Turso Cloud Typed collection for entity CRUD operations Fluent query builder API # Guides Source: https://easyaf.dev/blazoressentials/guides/index Learn how to build powerful Blazor applications with BlazorEssentials These guides walk you through the key features of BlazorEssentials, from client-side data storage to building complex multi-step wizards and implementing the MVVM pattern. ## Available Guides Store data locally in the browser with IndexedDB or TursoDb. Build offline-capable, local-first applications with optional cloud sync. ## Coming Soon Learn how to structure your Blazor applications using the Model-View-ViewModel pattern with `ViewModelBase`, `AppStateBase`, and reactive UI updates. Build multi-step wizards and complex workflows with the Merlin components. Guide users through operations with progress tracking and validation. More guides are being written. Check back soon or [contribute on GitHub](https://github.com/CloudNimble/BlazorEssentials). ## Quick Links NoSQL storage SQLite + Cloud Sync Full API docs # Blazoressentials Source: https://easyaf.dev/blazoressentials/index # AspNetCoreBreakdanceTestBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase A base class for building unit tests for AspNetCore APIs that automatically maintains a [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetc... ## Definition **Assembly:** CloudNimble.Breakdance.AspNetCore.dll **Namespace:** CloudNimble.Breakdance.AspNetCore **Inheritance:** CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase ``` ## Summary A base class for building unit tests for AspNetCore APIs that automatically maintains a [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with configuration and a Dependency Injection containers for you. ## Type Parameters * `TStartup` - ## Constructors ### .ctor Creates a new [AspNetCoreBreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase) instance. #### Syntax ```csharp theme={"dark"} public AspNetCoreBreakdanceTestBase() ``` #### Remarks The call to .Configure() with no content is required to get a minimal, empty [IWebHost](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.hosting.iwebhost). ### .ctor Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Creates a new [AspNetCoreBreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase) instance. #### Syntax ```csharp theme={"dark"} public AspNetCoreBreakdanceTestBase() ``` #### Remarks Uses the modern [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) pattern for web hosting instead of the deprecated WebHostBuilder. ## Properties ### TestHostBuilder Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Replaces the [AspNetCoreBreakdanceTestBase.TestHostBuilder](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testhostbuilder) from the [BreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase) with an [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) implementation configured for web hosting. #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.Hosting.IHostBuilder TestHostBuilder { get; internal set; } ``` #### Property Value Type: `Microsoft.Extensions.Hosting.IHostBuilder` ### TestServer Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` The [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) for handling requests. #### Syntax ```csharp theme={"dark"} public Microsoft.AspNetCore.TestHost.TestServer TestServer { get; internal set; } ``` #### Property Value Type: `Microsoft.AspNetCore.TestHost.TestServer` ## Methods ### AddApis Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Adds Controller services to the [AspNetCoreBreakdanceTestBase.TestHostBuilder](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testhostbuilder). #### Syntax ```csharp theme={"dark"} public void AddApis(System.Action options = null, System.Action app = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `System.Action` | - | | `app` | `System.Action` | - | #### Remarks Calls AddControllers() on the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) which does the following, according to the Microsoft docs: combines the effects of Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(Microsoft.Extensions.DependencyInjection.IServiceCollection), Microsoft.Extensions.DependencyInjection.MvcApiExplorerMvcCoreBuilderExtensions.AddApiExplorer(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcCoreMvcCoreBuilderExtensions.AddAuthorization(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcCorsMvcCoreBuilderExtensions.AddCors(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcDataAnnotationsMvcCoreBuilderExtensions.AddDataAnnotations(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), and Microsoft.Extensions.DependencyInjection.MvcCoreMvcCoreBuilderExtensions.AddFormatterMappings(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder). ### AddMinimalMvc Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Adds minimal MVC services to the [AspNetCoreBreakdanceTestBase.TestHostBuilder](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testhostbuilder). #### Syntax ```csharp theme={"dark"} public void AddMinimalMvc(System.Action options = null, System.Action app = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `System.Action` | - | | `app` | `System.Action` | - | #### Remarks Calls AddMvcCore() on the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) which does the following, according to the Microsoft docs: will register the minimum set of services necessary to route requests and invoke controllers. It is not expected that any application will satisfy its requirements with just a call to Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(Microsoft.Extensions.DependencyInjection.IServiceCollection). Additional configuration using the Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder will be required. ### AddRazorPages Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Adds support for Controllers and Razor views to the [AspNetCoreBreakdanceTestBase.TestHostBuilder](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testhostbuilder). #### Syntax ```csharp theme={"dark"} public void AddRazorPages(System.Action options = null, System.Action app = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `System.Action` | - | | `app` | `System.Action` | - | #### Remarks Calls AddRazorPages() on the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) which does the following, according to the Microsoft docs: combines the effects of Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(Microsoft.Extensions.DependencyInjection.IServiceCollection), Microsoft.Extensions.DependencyInjection.MvcCoreMvcCoreBuilderExtensions.AddAuthorization(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcDataAnnotationsMvcCoreBuilderExtensions.AddDataAnnotations(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.TagHelperServicesExtensions.AddCacheTagHelper(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), and Microsoft.Extensions.DependencyInjection.MvcRazorPagesMvcCoreBuilderExtensions.AddRazorPages(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder). ### AddViews Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Adds support for Controllers and Razor views to the [AspNetCoreBreakdanceTestBase.TestHostBuilder](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testhostbuilder). #### Syntax ```csharp theme={"dark"} public void AddViews(System.Action options = null, System.Action app = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `System.Action` | - | | `app` | `System.Action` | - | #### Remarks Calls AddControllersWithViews() on the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) which does the following, according to the Microsoft docs: combines the effects of Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(Microsoft.Extensions.DependencyInjection.IServiceCollection), Microsoft.Extensions.DependencyInjection.MvcApiExplorerMvcCoreBuilderExtensions.AddApiExplorer(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcCoreMvcCoreBuilderExtensions.AddAuthorization(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcCorsMvcCoreBuilderExtensions.AddCors(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcDataAnnotationsMvcCoreBuilderExtensions.AddDataAnnotations(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcCoreMvcCoreBuilderExtensions.AddFormatterMappings(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.TagHelperServicesExtensions.AddCacheTagHelper(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), Microsoft.Extensions.DependencyInjection.MvcViewFeaturesMvcCoreBuilderExtensions.AddViews(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder), and Microsoft.Extensions.DependencyInjection.MvcRazorMvcCoreBuilderExtensions.AddRazorViewEngine(Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder). ### AssemblySetup Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Method used by test assemblies to setup the environment. #### Syntax ```csharp theme={"dark"} public override void AssemblySetup() ``` #### Remarks With MSTest, use \[AssemblyInitialize]. With NUnit, use \[OneTimeSetup]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### AssemblySetupAsync Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Method used by test assemblies to setup the environment asynchronously. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task AssemblySetupAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[AssemblyInitialize]. With NUnit, use \[OneTimeSetUp]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### EnsureTestServer Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Ensures that the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) has been constructed. #### Syntax ```csharp theme={"dark"} internal void EnsureTestServer() ``` #### Remarks Builds the host using [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder), starts it, and retrieves the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) from the host services. ### EnsureTestServerAsync Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Ensures that the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) has been constructed asynchronously. #### Syntax ```csharp theme={"dark"} internal System.Threading.Tasks.Task EnsureTestServerAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks Builds the host using [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder), starts it, and retrieves the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) from the host services. ### GetHttpClient Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Retrieves an [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) instance from the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) and properly configures the [BaseAddress](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient.baseaddress). #### Syntax ```csharp theme={"dark"} public System.Net.Http.HttpClient GetHttpClient(string routePrefix = "api/tests/") ``` #### Parameters | Name | Type | Description | | - | - | - | | `routePrefix` | `string` | The string to append to the [BaseAddress](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient.baseaddress) for all requests. Defaults to [WebApiConstants.RoutePrefix](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/WebApiConstants#routeprefix). | #### Returns Type: `System.Net.Http.HttpClient` A properly configured [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient)instance from the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver). ### GetHttpClient Inherited Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Retrieves an [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) instance from the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) and properly configures the [BaseAddress](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient.baseaddress). #### Syntax ```csharp theme={"dark"} public System.Net.Http.HttpClient GetHttpClient(System.Net.Http.Headers.AuthenticationHeaderValue authHeader, string routePrefix = "api/tests/") ``` #### Parameters | Name | Type | Description | | - | - | - | | `authHeader` | `System.Net.Http.Headers.AuthenticationHeaderValue` | - | | `routePrefix` | `string` | The string to append to the [BaseAddress](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient.baseaddress) for all requests. Defaults to [WebApiConstants.RoutePrefix](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/WebApiConstants#routeprefix). | #### Returns Type: `System.Net.Http.HttpClient` A properly configured [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient)instance from the [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver). ### GetKeyedService Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Get service of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public override T GetKeyedService(string key) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The key of the service to get. | #### Returns Type: `T` A service object of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetKeyedServices Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Get services of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public override System.Collections.Generic.IEnumerable GetKeyedServices(string key) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The | #### Returns Type: `System.Collections.Generic.IEnumerable` An [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetService Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Get service of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public override T GetService() where T : class ``` #### Returns Type: `T` A service object of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetServices Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Get an enumeration of services of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public override System.Collections.Generic.IEnumerable GetServices() where T : class ``` #### Returns Type: `System.Collections.Generic.IEnumerable` An enumeration of services of type *T*. #### Type Parameters * `T` - The type of service object to get. ### TestSetup Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Method used by test classes to setup the environment. #### Syntax ```csharp theme={"dark"} public override void TestSetup() ``` #### Remarks With MSTest, use \[TestInitialize]. With NUnit, use \[Setup]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### TestSetupAsync Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Method used by test classes to setup the environment asynchronously. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task TestSetupAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[TestInitialize]. With NUnit, use \[SetUp]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### TestTearDown Override Inherited from `CloudNimble.Breakdance.AspNetCore.AspNetCoreBreakdanceTestBase` Method used by test classes to clean up the environment. #### Syntax ```csharp theme={"dark"} public override void TestTearDown() ``` #### Remarks With MSTest, use \[TestCleanup]. With NUnit, use \[TearDown]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) # AspNetCoreTestHelpers Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreTestHelpers Helper methods for creating testable resources for AspNetCore. ## Definition **Assembly:** CloudNimble.Breakdance.AspNetCore.dll **Namespace:** CloudNimble.Breakdance.AspNetCore **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.AspNetCore.AspNetCoreTestHelpers ``` ## Summary Helper methods for creating testable resources for AspNetCore. ## Methods ### GetTestableHttpServer Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with default services. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.TestHost.TestServer GetTestableHttpServer() ``` #### Returns Type: `Microsoft.AspNetCore.TestHost.TestServer` ### GetTestableHttpServer Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with the provided service registration. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.TestHost.TestServer GetTestableHttpServer(System.Action registration) ``` #### Parameters | Name | Type | Description | | - | - | - | | `registration` | `System.Action` | Delegate for customizing the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) of services available to the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | #### Returns Type: `Microsoft.AspNetCore.TestHost.TestServer` ### GetTestableHttpServer Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with the provided service registration and application builder. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.TestHost.TestServer GetTestableHttpServer(System.Action registration, System.Action builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `registration` | `System.Action` | Delegate for customizing the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) of services available to the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | | `builder` | `System.Action` | Delegate for customizing the [IApplicationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder)\ used to configure the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | #### Returns Type: `Microsoft.AspNetCore.TestHost.TestServer` ### GetTestableHttpServer Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with the provided service registration, application builder and configuration builder. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.TestHost.TestServer GetTestableHttpServer(System.Action registration, System.Action builder, System.Action configuration) ``` #### Parameters | Name | Type | Description | | - | - | - | | `registration` | `System.Action` | Delegate for customizing the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) of services available to the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | | `builder` | `System.Action` | Delegate for customizing the [IApplicationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder)\ used to configure the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | | `configuration` | `System.Action` | Delegate for providing an [IConfigurationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfigurationbuilder) used to generate an [IConfiguration](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfiguration) for the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | #### Returns Type: `Microsoft.AspNetCore.TestHost.TestServer` ### GetTestableHttpServerAsync Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with default services asynchronously. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task GetTestableHttpServerAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### GetTestableHttpServerAsync Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with the provided service registration asynchronously. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task GetTestableHttpServerAsync(System.Action registration) ``` #### Parameters | Name | Type | Description | | - | - | - | | `registration` | `System.Action` | Delegate for customizing the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) of services available to the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | #### Returns Type: `System.Threading.Tasks.Task` ### GetTestableHttpServerAsync Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with the provided service registration and application builder asynchronously. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task GetTestableHttpServerAsync(System.Action registration, System.Action builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `registration` | `System.Action` | Delegate for customizing the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) of services available to the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | | `builder` | `System.Action` | Delegate for customizing the [IApplicationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder)\ used to configure the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | #### Returns Type: `System.Threading.Tasks.Task` ### GetTestableHttpServerAsync Gets a new [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with the provided service registration, application builder and configuration builder asynchronously. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task GetTestableHttpServerAsync(System.Action registration, System.Action builder, System.Action configuration) ``` #### Parameters | Name | Type | Description | | - | - | - | | `registration` | `System.Action` | Delegate for customizing the [IServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) of services available to the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | | `builder` | `System.Action` | Delegate for customizing the [IApplicationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder)\ used to configure the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | | `configuration` | `System.Action` | Delegate for providing an [IConfigurationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfigurationbuilder) used to generate an [IConfiguration](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfiguration) for the [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver). | #### Returns Type: `System.Threading.Tasks.Task` # HttpClientHelpers Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/HttpClientHelpers Helper methods for dealing with [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage). ## Definition **Assembly:** CloudNimble.Breakdance.AspNetCore.dll **Namespace:** CloudNimble.Breakdance.AspNetCore **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.AspNetCore.HttpClientHelpers ``` ## Summary Helper methods for dealing with [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage). ## Methods ### GetTestableHttpRequestMessage Gets an [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) instance properly configured to be used to make test requests. #### Syntax ```csharp theme={"dark"} public static System.Net.Http.HttpRequestMessage GetTestableHttpRequestMessage(System.Net.Http.HttpMethod httpMethod, string host = "http://localhost/", string routePrefix = "api/tests/", string resource = "", string acceptHeader = "application/json", object payload = null, System.Text.Json.JsonSerializerOptions jsonSerializerSettings = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpMethod` | `System.Net.Http.HttpMethod` | The [HttpMethod](https://learn.microsoft.com/dotnet/api/system.net.http.httpmethod) to use for the request. | | `host` | `string` | The hostname to use for this request. Defaults to "[http://localhost](http://localhost)", only change it if that collides with other services running on the local machine. | | `routePrefix` | `string` | The routePrefix corresponding to the route already mapped in MapRestierRoute or GetTestableConfiguration. Defaults to "api/test", only change it if absolutely necessary. | | `resource` | `string` | The resource on the API to be requested. | | `acceptHeader` | `string` | The inbound MIME types to accept. Defaults to "application/json". | | `payload` | `object` | - | | `jsonSerializerSettings` | `System.Text.Json.JsonSerializerOptions` | - | #### Returns Type: `System.Net.Http.HttpRequestMessage` An [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) that is ready to be sent through an HttpClient instance configured for the test. # WebApiConstants Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/WebApiConstants A set of constants used by BreakDance.WebApi to simplify the configuration of test runs. ## Definition **Assembly:** CloudNimble.Breakdance.AspNetCore.dll **Namespace:** CloudNimble.Breakdance.AspNetCore **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.AspNetCore.WebApiConstants ``` ## Summary A set of constants used by BreakDance.WebApi to simplify the configuration of test runs. ## Remarks Since unit testing a WebApi should not require knowledge of a *specific* endpoint Url to execute (that's required in *integration* testing), these constants allow the test to run in a way that abstracts the details of configuring the API away from the developer. That allows the developer to focus on what is being tested, not on messing with configuration. # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/index Summary of the CloudNimble.Breakdance.AspNetCore Namespace ## Types ### Classes | Name | Summary | | - | - | | [AspNetCoreBreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase) | A base class for building unit tests for AspNetCore APIs that automatically maintains a [AspNetCoreBreakdanceTestBase.TestServer](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase#testserver) with configuration and a Dependency Injection containers for you. | | [AspNetCoreBreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreBreakdanceTestBase) | A base class for building unit tests for AspNetCore APIs that automatically maintains a [TestServer](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.testhost.testserver) with configuration and a Dependency Injection containers for you. | | [AspNetCoreTestHelpers](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/AspNetCoreTestHelpers) | Helper methods for creating testable resources for AspNetCore. | | [HttpClientHelpers](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/HttpClientHelpers) | Helper methods for dealing with [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage). | | [WebApiConstants](/breakdance/api-reference/CloudNimble/Breakdance/AspNetCore/WebApiConstants) | A set of constants used by BreakDance.WebApi to simplify the configuration of test runs. | # AssemblyConstants Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/AssemblyConstants ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.AssemblyConstants ``` # BreakdanceManifestGeneratorAttribute Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceManifestGeneratorAttribute Tells Breakdance that the attributed method generates a manifest file that is used to test functional outputs. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.BreakdanceManifestGeneratorAttribute ``` ## Summary Tells Breakdance that the attributed method generates a manifest file that is used to test functional outputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BreakdanceManifestGeneratorAttribute() ``` # BreakdanceTestAssemblyAttribute Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestAssemblyAttribute Tells Breakdance that the attributed method generates a manifest file that is used to test functional outputs. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.BreakdanceTestAssemblyAttribute ``` ## Summary Tells Breakdance that the attributed method generates a manifest file that is used to test functional outputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BreakdanceTestAssemblyAttribute() ``` # BreakdanceTestBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase A base class for unit tests that maintains an [IHost](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost) with configuration and a Dep... ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.BreakdanceTestBase ``` ## Summary A base class for unit tests that maintains an [IHost](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost) with configuration and a Dependency Injection container. ## Constructors ### .ctor Creates a new [BreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase) instance. #### Syntax ```csharp theme={"dark"} public BreakdanceTestBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DefaultScope Provides a default [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope) implementation to contain scoped services. #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.DependencyInjection.IServiceScope DefaultScope { get; set; } ``` #### Property Value Type: `Microsoft.Extensions.DependencyInjection.IServiceScope` ### TestHost The [IHost](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost) instance containing the test host. #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.Hosting.IHost TestHost { get; internal set; } ``` #### Property Value Type: `Microsoft.Extensions.Hosting.IHost` ### TestHostBuilder The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance used to configure the test host. #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.Hosting.IHostBuilder TestHostBuilder { get; internal set; } ``` #### Property Value Type: `Microsoft.Extensions.Hosting.IHostBuilder` ## Methods ### AssemblySetup Virtual Method used by test assemblies to setup the environment. #### Syntax ```csharp theme={"dark"} public virtual void AssemblySetup() ``` #### Remarks With MSTest, use \[AssemblyInitialize]. With NUnit, use \[OneTimeSetup]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) This method calls [BreakdanceTestBase.AssemblySetupAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#assemblysetupasync) synchronously. ### AssemblySetupAsync Virtual Method used by test assemblies to setup the environment asynchronously. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task AssemblySetupAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[AssemblyInitialize] with async Task return type. With NUnit, use \[OneTimeSetup] with async Task return type. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### AssemblyTearDown Virtual Method used by test assemblies to clean up the environment. #### Syntax ```csharp theme={"dark"} public virtual void AssemblyTearDown() ``` #### Remarks With MSTest, use \[AssemblyCleanup]. With NUnit, use \[OneTimeTearDown]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) This method calls [BreakdanceTestBase.AssemblyTearDownAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#assemblyteardownasync) synchronously. ### AssemblyTearDownAsync Virtual Method used by test assemblies to clean up the environment asynchronously. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task AssemblyTearDownAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[AssemblyCleanup] with async Task return type. With NUnit, use \[OneTimeTearDown] with async Task return type. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### ClassSetup Virtual Method used by test classes to setup the environment. #### Syntax ```csharp theme={"dark"} public virtual void ClassSetup() ``` #### Remarks With MSTest, use \[ClassInitialize]. With NUnit, use \[OneTimeSetup]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) This method calls [BreakdanceTestBase.ClassSetupAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#classsetupasync) synchronously. ### ClassSetupAsync Virtual Method used by test classes to setup the environment asynchronously. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task ClassSetupAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[ClassInitialize] with async Task return type. With NUnit, use \[OneTimeSetup] with async Task return type. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### ClassTearDown Virtual Method used by test classes to clean up the environment. #### Syntax ```csharp theme={"dark"} public virtual void ClassTearDown() ``` #### Remarks With MSTest, use \[ClassCleanup]. With NUnit, use \[OneTimeTearDown]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) This method calls [BreakdanceTestBase.ClassTearDownAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#classteardownasync) synchronously. ### ClassTearDownAsync Virtual Method used by test classes to clean up the environment asynchronously. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task ClassTearDownAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[ClassCleanup] with async Task return type. With NUnit, use \[OneTimeTearDown] with async Task return type. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### Dispose Clean up disposable objects in the environment. #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### DisposeAsync Asynchronously clean up disposable objects in the environment. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask DisposeAsync() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetKeyedService Virtual Get service of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public virtual T GetKeyedService(string key) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The key of the service to get. | #### Returns Type: `T` A service object of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetKeyedServices Virtual Get services of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public virtual System.Collections.Generic.IEnumerable GetKeyedServices(string key) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The | #### Returns Type: `System.Collections.Generic.IEnumerable` An [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetScopedService Get the requested service from the specified [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope). #### Syntax ```csharp theme={"dark"} public T GetScopedService(Microsoft.Extensions.DependencyInjection.IServiceScope scope) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `scope` | `Microsoft.Extensions.DependencyInjection.IServiceScope` | - | #### Returns Type: `T` #### Type Parameters * `T` - ### GetScopedService Get the requested service from the default [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope) provided by Breakdance. #### Syntax ```csharp theme={"dark"} public T GetScopedService() where T : class ``` #### Returns Type: `T` #### Type Parameters * `T` - ### GetScopedServices Get the requested service from the specified [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope). #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetScopedServices(Microsoft.Extensions.DependencyInjection.IServiceScope scope) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `scope` | `Microsoft.Extensions.DependencyInjection.IServiceScope` | - | #### Returns Type: `System.Collections.Generic.IEnumerable` #### Type Parameters * `T` - ### GetScopedServices Get the requested service from the default [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope) provided by Breakdance. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetScopedServices() where T : class ``` #### Returns Type: `System.Collections.Generic.IEnumerable` #### Type Parameters * `T` - ### GetService Virtual Get service of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public virtual T GetService() where T : class ``` #### Returns Type: `T` A service object of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetServices Virtual Get an enumeration of services of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public virtual System.Collections.Generic.IEnumerable GetServices() where T : class ``` #### Returns Type: `System.Collections.Generic.IEnumerable` An enumeration of services of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ResetTestHostBuilder Resets the test host by disposing of the current TestHost and initializing a new default TestHostBuilder. This prepares the environment for a fresh test setup. #### Syntax ```csharp theme={"dark"} public void ResetTestHostBuilder() ``` ### SetClaimsPrincipalSelectorToThreadPrincipal Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to the [CurrentPrincipal](https://learn.microsoft.com/dotnet/api/system.threading.thread.currentprincipal). #### Syntax ```csharp theme={"dark"} public static void SetClaimsPrincipalSelectorToThreadPrincipal() ``` #### Remarks This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container. ### SetClaimsPrincipalSelectorToThreadPrincipal Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to the [CurrentPrincipal](https://learn.microsoft.com/dotnet/api/system.threading.thread.currentprincipal) and sets the latter to a new ClaimsIdentity with the specified claims. #### Syntax ```csharp theme={"dark"} public static void SetClaimsPrincipalSelectorToThreadPrincipal(System.Collections.Generic.List claims, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role") ``` #### Parameters | Name | Type | Description | | - | - | - | | `claims` | `System.Collections.Generic.List` | The Claims to set for the test run. | | `authenticationType` | `string` | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests". | | `nameType` | `string` | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). | | `roleType` | `string` | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role). | #### Remarks This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container. ### SetClaimsPrincipalSelectorToThreadPrincipal Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to the [CurrentPrincipal](https://learn.microsoft.com/dotnet/api/system.threading.thread.currentprincipal) and sets the latter to a new ClaimsIdentity with the specified claim. #### Syntax ```csharp theme={"dark"} public static void SetClaimsPrincipalSelectorToThreadPrincipal(System.Security.Claims.Claim claim, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role") ``` #### Parameters | Name | Type | Description | | - | - | - | | `claim` | `System.Security.Claims.Claim` | The Claims to set for the test run. | | `authenticationType` | `string` | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests". | | `nameType` | `string` | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). | | `roleType` | `string` | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role). | #### Remarks This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container. ### SetThreadPrincipal Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to a new ClaimsIdentity with the specified claims. #### Syntax ```csharp theme={"dark"} public static void SetThreadPrincipal(System.Collections.Generic.List claims, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role") ``` #### Parameters | Name | Type | Description | | - | - | - | | `claims` | `System.Collections.Generic.List` | The Claims to set for the test run. | | `authenticationType` | `string` | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests". | | `nameType` | `string` | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). | | `roleType` | `string` | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role). | #### Remarks This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container. ### SetThreadPrincipal Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to a new ClaimsIdentity with the specified claim. #### Syntax ```csharp theme={"dark"} public static void SetThreadPrincipal(System.Security.Claims.Claim claim, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role") ``` #### Parameters | Name | Type | Description | | - | - | - | | `claim` | `System.Security.Claims.Claim` | The Claims to set for the test run. | | `authenticationType` | `string` | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests". | | `nameType` | `string` | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). | | `roleType` | `string` | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role). | #### Remarks This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container. ### TestSetup Virtual Method used by test classes to setup the environment. #### Syntax ```csharp theme={"dark"} public virtual void TestSetup() ``` #### Remarks With MSTest, use \[TestInitialize]. With NUnit, use \[Setup]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) This method calls [BreakdanceTestBase.TestSetupAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#testsetupasync) synchronously. ### TestSetupAsync Virtual Method used by test classes to setup the environment asynchronously. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task TestSetupAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[TestInitialize] with async Task return type. With NUnit, use \[Setup] with async Task return type. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### TestTearDown Virtual Method used by test classes to clean up the environment. #### Syntax ```csharp theme={"dark"} public virtual void TestTearDown() ``` #### Remarks With MSTest, use \[TestCleanup]. With NUnit, use \[TearDown]. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) This method calls [BreakdanceTestBase.TestTearDownAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#testteardownasync) synchronously. ### TestTearDownAsync Virtual Method used by test classes to clean up the environment asynchronously. #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task TestTearDownAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` #### Remarks With MSTest, use \[TestCleanup] with async Task return type. With NUnit, use \[TearDown] with async Task return type. With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context) ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IDisposable * System.IAsyncDisposable # ResponseSnapshotCaptureHandler Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler A [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) that captures HTTP responses and saves them as snapshot files. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies.Http **Inheritance:** CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotCaptureHandler ``` ## Summary A [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) that captures HTTP responses and saves them as snapshot files. ## Remarks This handler passes requests through to the actual endpoint, then captures the response and saves it as a snapshot file. This enables recording real API responses for later replay during testing. Use this handler during an initial recording phase to capture responses from third-party APIs, then use [ResponseSnapshotReplayHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler) to replay those responses during test execution without hitting live endpoints. ## Examples ```csharp theme={"dark"} // Create a handler that captures responses to snapshot files var innerHandler = new HttpClientHandler(); var captureHandler = new ResponseSnapshotCaptureHandler("TestData/Snapshots") { InnerHandler = innerHandler }; var client = new HttpClient(captureHandler); // Requests go to the real endpoint, responses are saved as snapshots var response = await client.GetAsync("https://api.example.com/users"); ``` ## Constructors ### .ctor Creates a new [ResponseSnapshotCaptureHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler) that saves response snapshots to the specified path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotCaptureHandler(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | ### .ctor Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Creates a new [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) with the specified snapshot storage path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotHandlerBase(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | #### Examples ```csharp theme={"dark"} var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots"); var client = new HttpClient(handler); ``` ## Properties ### ResponseSnapshotsPath Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Gets the root folder path where response snapshot files are stored. #### Syntax ```csharp theme={"dark"} public string ResponseSnapshotsPath { get; private set; } ``` #### Property Value Type: `string` ## Methods ### GetFileExtensionString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the MediaType header in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to a known list of file extensions. #### Syntax ```csharp theme={"dark"} public static string GetFileExtensionString(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The request to examine. | #### Returns Type: `string` The file extension string for the request's Accept header. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when request is null. | ### GetPathInfo Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Parses the RequestUri in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) into a [Path](https://learn.microsoft.com/dotnet/api/system.io.path)-safe string suitable for storing response snapshots on the file system. #### Syntax ```csharp theme={"dark"} internal static (string, string) GetPathInfo(System.Net.Http.HttpRequestMessage request, string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to parse. | | `responseSnapshotsPath` | `string` | Root folder for storing snapshot files. | #### Returns Type: `(string, string)` A tuple containing the directory path and file path components. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when the request has an invalid RequestUri. | | `InvalidOperationException` | Thrown when the URI cannot be converted to a valid file path. | ### GetResponseMediaTypeString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the file extension in the specified path to a known list of media types. #### Syntax ```csharp theme={"dark"} public static string GetResponseMediaTypeString(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to examine. | #### Returns Type: `string` The MIME type string for the file extension. # ResponseSnapshotHandlerBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase Base class for Response Snapshot handlers that enable testing with real captured HTTP responses. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies.Http **Inheritance:** System.Net.Http.DelegatingHandler ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase ``` ## Summary Base class for Response Snapshot handlers that enable testing with real captured HTTP responses. ## Remarks Response Snapshots are real HTTP responses captured from actual API calls and stored as files. This allows testing against real response data without hitting live endpoints or polluting third-party services with test data. Use [ResponseSnapshotCaptureHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler) to capture responses from live APIs, then use [ResponseSnapshotReplayHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler) to replay those responses in tests. ## Constructors ### .ctor Creates a new [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) with the specified snapshot storage path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotHandlerBase(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | #### Examples ```csharp theme={"dark"} var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots"); var client = new HttpClient(handler); ``` ## Properties ### ResponseSnapshotsPath Gets the root folder path where response snapshot files are stored. #### Syntax ```csharp theme={"dark"} public string ResponseSnapshotsPath { get; private set; } ``` #### Property Value Type: `string` ## Methods ### GetFileExtensionString Maps the MediaType header in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to a known list of file extensions. #### Syntax ```csharp theme={"dark"} public static string GetFileExtensionString(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The request to examine. | #### Returns Type: `string` The file extension string for the request's Accept header. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when request is null. | ### GetResponseMediaTypeString Maps the file extension in the specified path to a known list of media types. #### Syntax ```csharp theme={"dark"} public static string GetResponseMediaTypeString(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to examine. | #### Returns Type: `string` The MIME type string for the file extension. # ResponseSnapshotReplayHandler Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler A [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) that replays previously captured HTTP responses from snapshot... ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies.Http **Inheritance:** CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotReplayHandler ``` ## Summary A [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) that replays previously captured HTTP responses from snapshot files. ## Remarks This handler intercepts outgoing HTTP requests and returns responses from snapshot files instead of making actual network calls. This enables deterministic testing against real response data without hitting live endpoints. Response snapshots are typically captured using [ResponseSnapshotCaptureHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler) during an initial recording phase, then replayed during test execution. ## Examples ```csharp theme={"dark"} // Create a handler that reads from snapshot files var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots"); var client = new HttpClient(handler); // Requests will be served from snapshot files instead of the network var response = await client.GetAsync("https://api.example.com/users"); ``` ## Constructors ### .ctor Creates a new [ResponseSnapshotReplayHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler) that reads response snapshots from the specified path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotReplayHandler(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path containing response snapshot files. | ### .ctor Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Creates a new [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) with the specified snapshot storage path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotHandlerBase(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | #### Examples ```csharp theme={"dark"} var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots"); var client = new HttpClient(handler); ``` ## Properties ### ResponseSnapshotsPath Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Gets the root folder path where response snapshot files are stored. #### Syntax ```csharp theme={"dark"} public string ResponseSnapshotsPath { get; private set; } ``` #### Property Value Type: `string` ## Methods ### GetFileExtensionString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the MediaType header in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to a known list of file extensions. #### Syntax ```csharp theme={"dark"} public static string GetFileExtensionString(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The request to examine. | #### Returns Type: `string` The file extension string for the request's Accept header. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when request is null. | ### GetPathInfo Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Parses the RequestUri in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) into a [Path](https://learn.microsoft.com/dotnet/api/system.io.path)-safe string suitable for storing response snapshots on the file system. #### Syntax ```csharp theme={"dark"} internal static (string, string) GetPathInfo(System.Net.Http.HttpRequestMessage request, string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to parse. | | `responseSnapshotsPath` | `string` | Root folder for storing snapshot files. | #### Returns Type: `(string, string)` A tuple containing the directory path and file path components. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when the request has an invalid RequestUri. | | `InvalidOperationException` | Thrown when the URI cannot be converted to a valid file path. | ### GetResponseMediaTypeString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the file extension in the specified path to a known list of media types. #### Syntax ```csharp theme={"dark"} public static string GetResponseMediaTypeString(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to examine. | #### Returns Type: `string` The MIME type string for the file extension. # TestCacheDelegatingHandlerBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheDelegatingHandlerBase Base class for implementation of TestCache handlers for unit testing. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies.Http **Inheritance:** CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.Http.TestCacheDelegatingHandlerBase ``` ## Summary Base class for implementation of TestCache handlers for unit testing. ## Remarks This class is deprecated. Use [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) instead. ## Constructors ### .ctor Creates a new [TestCacheDelegatingHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheDelegatingHandlerBase) with the specified root folder path. #### Syntax ```csharp theme={"dark"} public TestCacheDelegatingHandlerBase(string responseFilesPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseFilesPath` | `string` | Root folder path for storing static response files. | #### Remarks This constructor is deprecated. Use [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) instead. ### .ctor Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Creates a new [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) with the specified snapshot storage path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotHandlerBase(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | #### Examples ```csharp theme={"dark"} var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots"); var client = new HttpClient(handler); ``` ## Properties ### ResponseFilesPath Gets the root folder path for reading/writing static response files. #### Syntax ```csharp theme={"dark"} public string ResponseFilesPath { get; } ``` #### Property Value Type: `string` #### Remarks This property is deprecated. Use [ResponseSnapshotHandlerBase.ResponseSnapshotsPath](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase#responsesnapshotspath) instead. ### ResponseSnapshotsPath Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Gets the root folder path where response snapshot files are stored. #### Syntax ```csharp theme={"dark"} public string ResponseSnapshotsPath { get; private set; } ``` #### Property Value Type: `string` ## Methods ### GetFileExtensionString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the MediaType header in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to a known list of file extensions. #### Syntax ```csharp theme={"dark"} public static string GetFileExtensionString(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The request to examine. | #### Returns Type: `string` The file extension string for the request's Accept header. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when request is null. | ### GetPathInfo Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Parses the RequestUri in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) into a [Path](https://learn.microsoft.com/dotnet/api/system.io.path)-safe string suitable for storing response snapshots on the file system. #### Syntax ```csharp theme={"dark"} internal static (string, string) GetPathInfo(System.Net.Http.HttpRequestMessage request, string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to parse. | | `responseSnapshotsPath` | `string` | Root folder for storing snapshot files. | #### Returns Type: `(string, string)` A tuple containing the directory path and file path components. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when the request has an invalid RequestUri. | | `InvalidOperationException` | Thrown when the URI cannot be converted to a valid file path. | ### GetResponseMediaTypeString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the file extension in the specified path to a known list of media types. #### Syntax ```csharp theme={"dark"} public static string GetResponseMediaTypeString(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to examine. | #### Returns Type: `string` The MIME type string for the file extension. # TestCacheReadDelegatingHandler Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheReadDelegatingHandler Handler for returning HTTP responses from cached files. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies.Http **Inheritance:** CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotReplayHandler ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.Http.TestCacheReadDelegatingHandler ``` ## Summary Handler for returning HTTP responses from cached files. ## Remarks This class is deprecated. Use [ResponseSnapshotReplayHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler) instead. ## Constructors ### .ctor Creates a new [TestCacheReadDelegatingHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheReadDelegatingHandler) with the specified root folder path. #### Syntax ```csharp theme={"dark"} public TestCacheReadDelegatingHandler(string responseFilesPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseFilesPath` | `string` | Root folder path for storing static response files. | #### Remarks This constructor is deprecated. Use [ResponseSnapshotReplayHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler) instead. ### .ctor Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotReplayHandler` Creates a new [ResponseSnapshotReplayHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler) that reads response snapshots from the specified path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotReplayHandler(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path containing response snapshot files. | ### .ctor Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Creates a new [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) with the specified snapshot storage path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotHandlerBase(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | #### Examples ```csharp theme={"dark"} var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots"); var client = new HttpClient(handler); ``` ## Properties ### ResponseSnapshotsPath Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Gets the root folder path where response snapshot files are stored. #### Syntax ```csharp theme={"dark"} public string ResponseSnapshotsPath { get; private set; } ``` #### Property Value Type: `string` ## Methods ### GetFileExtensionString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the MediaType header in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to a known list of file extensions. #### Syntax ```csharp theme={"dark"} public static string GetFileExtensionString(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The request to examine. | #### Returns Type: `string` The file extension string for the request's Accept header. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when request is null. | ### GetPathInfo Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Parses the RequestUri in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) into a [Path](https://learn.microsoft.com/dotnet/api/system.io.path)-safe string suitable for storing response snapshots on the file system. #### Syntax ```csharp theme={"dark"} internal static (string, string) GetPathInfo(System.Net.Http.HttpRequestMessage request, string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to parse. | | `responseSnapshotsPath` | `string` | Root folder for storing snapshot files. | #### Returns Type: `(string, string)` A tuple containing the directory path and file path components. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when the request has an invalid RequestUri. | | `InvalidOperationException` | Thrown when the URI cannot be converted to a valid file path. | ### GetResponseMediaTypeString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the file extension in the specified path to a known list of media types. #### Syntax ```csharp theme={"dark"} public static string GetResponseMediaTypeString(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to examine. | #### Returns Type: `string` The MIME type string for the file extension. ### SendAsync Override Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotReplayHandler` Intercepts the HTTP request and returns a response loaded from a snapshot file. #### Syntax ```csharp theme={"dark"} protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) being intercepted. | | `cancellationToken` | `System.Threading.CancellationToken` | Token for cancelling the asynchronous operation. | #### Returns Type: `System.Threading.Tasks.Task` An [HttpResponseMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage) with content loaded from the corresponding snapshot file. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *request* is null. | | `InvalidOperationException` | Thrown when no snapshot file exists for the request. | ### SendAsyncInternal Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotReplayHandler` Allows test projects to call the otherwise inaccessible `CancellationToken)` method directly. #### Syntax ```csharp theme={"dark"} internal System.Threading.Tasks.Task SendAsyncInternal(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to process. | #### Returns Type: `System.Threading.Tasks.Task` The [HttpResponseMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage) loaded from the snapshot file. # TestCacheWriteDelegatingHandler Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheWriteDelegatingHandler Handler for capturing HTTP responses and writing them to files. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies.Http **Inheritance:** CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotCaptureHandler ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.Http.TestCacheWriteDelegatingHandler ``` ## Summary Handler for capturing HTTP responses and writing them to files. ## Remarks This class is deprecated. Use [ResponseSnapshotCaptureHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler) instead. ## Constructors ### .ctor Creates a new [TestCacheWriteDelegatingHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheWriteDelegatingHandler) with the specified root folder path. #### Syntax ```csharp theme={"dark"} public TestCacheWriteDelegatingHandler(string responseFilesPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseFilesPath` | `string` | Root folder path for storing static response files. | #### Remarks This constructor is deprecated. Use [ResponseSnapshotCaptureHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler) instead. ### .ctor Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotCaptureHandler` Creates a new [ResponseSnapshotCaptureHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler) that saves response snapshots to the specified path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotCaptureHandler(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | ### .ctor Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Creates a new [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) with the specified snapshot storage path. #### Syntax ```csharp theme={"dark"} public ResponseSnapshotHandlerBase(string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `responseSnapshotsPath` | `string` | Root folder path for storing response snapshot files. | #### Examples ```csharp theme={"dark"} var handler = new ResponseSnapshotReplayHandler("TestData/Snapshots"); var client = new HttpClient(handler); ``` ## Properties ### ResponseSnapshotsPath Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Gets the root folder path where response snapshot files are stored. #### Syntax ```csharp theme={"dark"} public string ResponseSnapshotsPath { get; private set; } ``` #### Property Value Type: `string` ## Methods ### GetFileExtensionString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the MediaType header in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to a known list of file extensions. #### Syntax ```csharp theme={"dark"} public static string GetFileExtensionString(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The request to examine. | #### Returns Type: `string` The file extension string for the request's Accept header. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when request is null. | ### GetPathInfo Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Parses the RequestUri in the [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) into a [Path](https://learn.microsoft.com/dotnet/api/system.io.path)-safe string suitable for storing response snapshots on the file system. #### Syntax ```csharp theme={"dark"} internal static (string, string) GetPathInfo(System.Net.Http.HttpRequestMessage request, string responseSnapshotsPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to parse. | | `responseSnapshotsPath` | `string` | Root folder for storing snapshot files. | #### Returns Type: `(string, string)` A tuple containing the directory path and file path components. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when the request has an invalid RequestUri. | | `InvalidOperationException` | Thrown when the URI cannot be converted to a valid file path. | ### GetResponseMediaTypeString Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotHandlerBase` Maps the file extension in the specified path to a known list of media types. #### Syntax ```csharp theme={"dark"} public static string GetResponseMediaTypeString(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The file path to examine. | #### Returns Type: `string` The MIME type string for the file extension. ### SendAsync Override Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotCaptureHandler` Sends the request to the actual endpoint and captures the response as a snapshot file. #### Syntax ```csharp theme={"dark"} protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) being intercepted. | | `cancellationToken` | `System.Threading.CancellationToken` | Token for cancelling the asynchronous operation. | #### Returns Type: `System.Threading.Tasks.Task` The [HttpResponseMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage) from the actual endpoint. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *request* is null. | ### SendAsyncInternal Inherited Inherited from `CloudNimble.Breakdance.Assemblies.Http.ResponseSnapshotCaptureHandler` Allows test projects to call the otherwise inaccessible `CancellationToken)` method directly. #### Syntax ```csharp theme={"dark"} internal System.Threading.Tasks.Task SendAsyncInternal(System.Net.Http.HttpRequestMessage request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `request` | `System.Net.Http.HttpRequestMessage` | The [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) to process. | #### Returns Type: `System.Threading.Tasks.Task` The [HttpResponseMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage) from the actual endpoint. # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/index Summary of the CloudNimble.Breakdance.Assemblies.Http Namespace ## Types ### Classes | Name | Summary | | - | - | | [ResponseSnapshotCaptureHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotCaptureHandler) | A [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) that captures HTTP responses and saves them as snapshot files. | | [ResponseSnapshotHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotHandlerBase) | Base class for Response Snapshot handlers that enable testing with real captured HTTP responses. | | [ResponseSnapshotReplayHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/ResponseSnapshotReplayHandler) | A [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) that replays previously captured HTTP responses from snapshot files. | | [TestCacheDelegatingHandlerBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheDelegatingHandlerBase) | Base class for implementation of TestCache handlers for unit testing. | | [TestCacheReadDelegatingHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheReadDelegatingHandler) | Handler for returning HTTP responses from cached files. | | [TestCacheWriteDelegatingHandler](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/Http/TestCacheWriteDelegatingHandler) | Handler for capturing HTTP responses and writing them to files. | # MemberComparer Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/MemberComparer Legacy class used to compare members. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.MemberComparer ``` ## Summary Legacy class used to compare members. ## Remarks Should be rewritten or eliminated at our earliest possible convenience. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public MemberComparer(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Compare #### Syntax ```csharp theme={"dark"} public int Compare(object x, object y) ``` #### Parameters | Name | Type | Description | | - | - | - | | `x` | `object` | - | | `y` | `object` | - | #### Returns Type: `int` ### Compare #### Syntax ```csharp theme={"dark"} public int Compare(System.Reflection.MemberInfo x, System.Reflection.MemberInfo y) ``` #### Parameters | Name | Type | Description | | - | - | - | | `x` | `System.Reflection.MemberInfo` | - | | `y` | `System.Reflection.MemberInfo` | - | #### Returns Type: `int` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.Collections.IComparer * System.Collections.Generic.IComparer\ # MemberDefinition Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/MemberDefinition Allows for the storage of metadata information for a specific type member. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.MemberDefinition ``` ## Summary Allows for the storage of metadata information for a specific type member. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public MemberDefinition(string member, System.Collections.Generic.List attributes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `member` | `string` | - | | `attributes` | `System.Collections.Generic.List` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Attributes A [List\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) containing the full name of each attribute on the type member. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Attributes { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### MemberName The full name of the type member in question. #### Syntax ```csharp theme={"dark"} public string MemberName { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ObjectTypeComparer Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/ObjectTypeComparer Legacy class used to compare types. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.ObjectTypeComparer ``` ## Summary Legacy class used to compare types. ## Remarks Should be rewritten or eliminated at our earliest possible convenience. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ObjectTypeComparer() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Compare #### Syntax ```csharp theme={"dark"} public int Compare(object x, object y) ``` #### Parameters | Name | Type | Description | | - | - | - | | `x` | `object` | - | | `y` | `object` | - | #### Returns Type: `int` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.Collections.IComparer * System.Collections.Generic.IComparer\ # PrivateObject Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject This class represents the live NON public INTERNAL object in the system ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.PrivateObject ``` ## Summary This class represents the live NON public INTERNAL object in the system ## Remarks This type originally lived in Microsoft.VisualStudio.TestTools.UnitTesting but was removed from V2. ## Constructors ### .ctor Initializes a new instance of the [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) class that contains the already existing object of the private class #### Syntax ```csharp theme={"dark"} public PrivateObject(object obj, string memberToAccess) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | object that serves as starting point to reach the private members | | `memberToAccess` | `string` | the derefrencing string using . that points to the object to be retrived as in m\_X.m\_Y.m\_Z | ### .ctor Initializes a new instance of the [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) class that wraps the specified type. #### Syntax ```csharp theme={"dark"} public PrivateObject(string assemblyName, string typeName, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `assemblyName` | `string` | Name of the assembly | | `typeName` | `string` | fully qualified name | | `args` | `object[]` | Argmenets to pass to the constructor | ### .ctor Initializes a new instance of the [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) class that wraps the specified type. #### Syntax ```csharp theme={"dark"} public PrivateObject(string assemblyName, string typeName, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `assemblyName` | `string` | Name of the assembly | | `typeName` | `string` | fully qualified name | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the constructor to get | | `args` | `object[]` | Arguments to pass to the constructor | ### .ctor Initializes a new instance of the [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) class that wraps the specified type. #### Syntax ```csharp theme={"dark"} public PrivateObject(System.Type type, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | type of the object to create | | `args` | `object[]` | Arguments to pass to the constructor | ### .ctor Initializes a new instance of the [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) class that wraps the specified type. #### Syntax ```csharp theme={"dark"} public PrivateObject(System.Type type, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | type of the object to create | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the constructor to get | | `args` | `object[]` | Arguments to pass to the constructor | ### .ctor Initializes a new instance of the [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) class that wraps the given object. #### Syntax ```csharp theme={"dark"} public PrivateObject(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | object to wrap | ### .ctor Initializes a new instance of the [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) class that wraps the given object. #### Syntax ```csharp theme={"dark"} public PrivateObject(object obj, CloudNimble.Breakdance.Assemblies.PrivateType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | object to wrap | | `type` | `CloudNimble.Breakdance.Assemblies.PrivateType` | PrivateType object | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### RealType Gets the type of underlying object #### Syntax ```csharp theme={"dark"} public System.Type RealType { get; } ``` #### Property Value Type: `System.Type` ### Target Gets or sets the target #### Syntax ```csharp theme={"dark"} public object Target { get; set; } ``` #### Property Value Type: `object` ## Methods ### Equals Override Equals #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | Object with whom to compare | #### Returns Type: `bool` returns true if the objects are equal. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetArrayElement Gets the array element using array of subsrcipts for each dimension #### Syntax ```csharp theme={"dark"} public object GetArrayElement(string name, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `indices` | `int[]` | the indices of array | #### Returns Type: `object` An arrya of elements. ### GetArrayElement Gets the array element using array of subsrcipts for each dimension #### Syntax ```csharp theme={"dark"} public object GetArrayElement(string name, System.Reflection.BindingFlags bindingFlags, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `indices` | `int[]` | the indices of array | #### Returns Type: `object` An arrya of elements. ### GetField Get the field #### Syntax ```csharp theme={"dark"} public object GetField(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | #### Returns Type: `object` The field. ### GetField Gets the field #### Syntax ```csharp theme={"dark"} public object GetField(string name, System.Reflection.BindingFlags bindingFlags) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | #### Returns Type: `object` The field. ### GetFieldOrProperty Get the field or property #### Syntax ```csharp theme={"dark"} public object GetFieldOrProperty(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | #### Returns Type: `object` The field or property. ### GetFieldOrProperty Gets the field or property #### Syntax ```csharp theme={"dark"} public object GetFieldOrProperty(string name, System.Reflection.BindingFlags bindingFlags) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | #### Returns Type: `object` The field or property. ### GetHashCode Override returns the hash code of the target object #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` int representing hashcode of the target object ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetProperty Gets the property #### Syntax ```csharp theme={"dark"} public object GetProperty(string name, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` The property. ### GetProperty Gets the property #### Syntax ```csharp theme={"dark"} public object GetProperty(string name, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the indexed property. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` The property. ### GetProperty Gets the property #### Syntax ```csharp theme={"dark"} public object GetProperty(string name, System.Reflection.BindingFlags bindingFlags, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` The property. ### GetProperty Gets the property #### Syntax ```csharp theme={"dark"} public object GetProperty(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the indexed property. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` The property. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to get. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Type[] parameterTypes, object[] args, System.Type[] typeArguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to get. | | `args` | `object[]` | Arguments to pass to the member to invoke. | | `typeArguments` | `System.Type[]` | An array of types corresponding to the types of the generic arguments. | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `args` | `object[]` | Arguments to pass to the member to invoke. | | `culture` | `System.Globalization.CultureInfo` | Culture info | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Type[] parameterTypes, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to get. | | `args` | `object[]` | Arguments to pass to the member to invoke. | | `culture` | `System.Globalization.CultureInfo` | Culture info | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Reflection.BindingFlags bindingFlags, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to get. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Reflection.BindingFlags bindingFlags, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `args` | `object[]` | Arguments to pass to the member to invoke. | | `culture` | `System.Globalization.CultureInfo` | Culture info | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to get. | | `args` | `object[]` | Arguments to pass to the member to invoke. | | `culture` | `System.Globalization.CultureInfo` | Culture info | #### Returns Type: `object` Result of method call ### Invoke Invokes the specified method #### Syntax ```csharp theme={"dark"} public object Invoke(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args, System.Globalization.CultureInfo culture, System.Type[] typeArguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the method | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to get. | | `args` | `object[]` | Arguments to pass to the member to invoke. | | `culture` | `System.Globalization.CultureInfo` | Culture info | | `typeArguments` | `System.Type[]` | An array of types corresponding to the types of the generic arguments. | #### Returns Type: `object` Result of method call ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetArrayElement Sets the array element using array of subsrcipts for each dimension #### Syntax ```csharp theme={"dark"} public void SetArrayElement(string name, object value, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `value` | `object` | Value to set | | `indices` | `int[]` | the indices of array | ### SetArrayElement Sets the array element using array of subsrcipts for each dimension #### Syntax ```csharp theme={"dark"} public void SetArrayElement(string name, System.Reflection.BindingFlags bindingFlags, object value, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `value` | `object` | Value to set | | `indices` | `int[]` | the indices of array | ### SetField Sets the field #### Syntax ```csharp theme={"dark"} public void SetField(string name, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | | `value` | `object` | value to set | ### SetField Sets the field #### Syntax ```csharp theme={"dark"} public void SetField(string name, System.Reflection.BindingFlags bindingFlags, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `value` | `object` | value to set | ### SetFieldOrProperty Sets the field or property #### Syntax ```csharp theme={"dark"} public void SetFieldOrProperty(string name, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | | `value` | `object` | value to set | ### SetFieldOrProperty Sets the field or property #### Syntax ```csharp theme={"dark"} public void SetFieldOrProperty(string name, System.Reflection.BindingFlags bindingFlags, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `value` | `object` | value to set | ### SetProperty Set the property #### Syntax ```csharp theme={"dark"} public void SetProperty(string name, object value, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `value` | `object` | value to set | | `args` | `object[]` | Arguments to pass to the member to invoke. | ### SetProperty Set the property #### Syntax ```csharp theme={"dark"} public void SetProperty(string name, System.Type[] parameterTypes, object value, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the indexed property. | | `value` | `object` | value to set | | `args` | `object[]` | Arguments to pass to the member to invoke. | ### SetProperty Sets the property #### Syntax ```csharp theme={"dark"} public void SetProperty(string name, System.Reflection.BindingFlags bindingFlags, object value, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `value` | `object` | value to set | | `args` | `object[]` | Arguments to pass to the member to invoke. | ### SetProperty Sets the property #### Syntax ```csharp theme={"dark"} public void SetProperty(string name, System.Reflection.BindingFlags bindingFlags, object value, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | A bitmask comprised of one or more [BindingFlags](https://learn.microsoft.com/dotnet/api/system.reflection.bindingflags) that specify how the search is conducted. | | `value` | `object` | value to set | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the indexed property. | | `args` | `object[]` | Arguments to pass to the member to invoke. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PrivateType Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateType This class represents a private class for the Private Accessor functionality. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.PrivateType ``` ## Summary This class represents a private class for the Private Accessor functionality. ## Remarks This type originally lived in Microsoft.VisualStudio.TestTools.UnitTesting but was removed from V2. ## Constructors ### .ctor Initializes a new instance of the [PrivateType](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateType) class that contains the private type. #### Syntax ```csharp theme={"dark"} public PrivateType(string assemblyName, string typeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `assemblyName` | `string` | Assembly name | | `typeName` | `string` | fully qualified name of the | ### .ctor Initializes a new instance of the [PrivateType](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateType) class that contains the private type from the type object #### Syntax ```csharp theme={"dark"} public PrivateType(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The wrapped Type to create. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ReferencedType Gets the referenced type #### Syntax ```csharp theme={"dark"} public System.Type ReferencedType { get; } ``` #### Property Value Type: `System.Type` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetStaticArrayElement Gets the element in static array #### Syntax ```csharp theme={"dark"} public object GetStaticArrayElement(string name, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the array | | `indices` | `int[]` | A one-dimensional array of 32-bit integers that represent the indexes specifying | | the position of the element to get. For instance, to access a\[10]\[11] the indices would be | | | #### Returns Type: `object` element at the specified location ### GetStaticArrayElement Gets the element in satatic array #### Syntax ```csharp theme={"dark"} public object GetStaticArrayElement(string name, System.Reflection.BindingFlags bindingFlags, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the array | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional InvokeHelper attributes | | `indices` | `int[]` | A one-dimensional array of 32-bit integers that represent the indexes specifying | | the position of the element to get. For instance, to access a\[10]\[11] the array would be | | | #### Returns Type: `object` element at the spcified location ### GetStaticField Gets the static field #### Syntax ```csharp theme={"dark"} public object GetStaticField(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | #### Returns Type: `object` The static field. ### GetStaticField Gets the static field using specified InvokeHelper attributes #### Syntax ```csharp theme={"dark"} public object GetStaticField(string name, System.Reflection.BindingFlags bindingFlags) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | #### Returns Type: `object` The static field. ### GetStaticFieldOrProperty Gets the static field or property #### Syntax ```csharp theme={"dark"} public object GetStaticFieldOrProperty(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | #### Returns Type: `object` The static field or property. ### GetStaticFieldOrProperty Gets the static field or property using specified InvokeHelper attributes #### Syntax ```csharp theme={"dark"} public object GetStaticFieldOrProperty(string name, System.Reflection.BindingFlags bindingFlags) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | #### Returns Type: `object` The static field or property. ### GetStaticProperty Gets the static property #### Syntax ```csharp theme={"dark"} public object GetStaticProperty(string name, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | | `args` | `object[]` | Arguements to the invocation | #### Returns Type: `object` The static property. ### GetStaticProperty Gets the static property #### Syntax ```csharp theme={"dark"} public object GetStaticProperty(string name, System.Reflection.BindingFlags bindingFlags, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` The static property. ### GetStaticProperty Gets the static property #### Syntax ```csharp theme={"dark"} public object GetStaticProperty(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes. | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the indexed property. | | `args` | `object[]` | Arguments to pass to the member to invoke. | #### Returns Type: `object` The static property. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### InvokeStatic Invokes static member #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member to InvokeHelper | | `args` | `object[]` | Arguements to the invoction | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes static member #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member to InvokeHelper | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to invoke | | `args` | `object[]` | Arguements to the invoction | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes static member #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Type[] parameterTypes, object[] args, System.Type[] typeArguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member to InvokeHelper | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to invoke | | `args` | `object[]` | Arguements to the invoction | | `typeArguments` | `System.Type[]` | An array of types corresponding to the types of the generic arguments. | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes the static method #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `args` | `object[]` | Arguements to the invocation | | `culture` | `System.Globalization.CultureInfo` | Culture | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes the static method #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Type[] parameterTypes, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to invoke | | `args` | `object[]` | Arguements to the invocation | | `culture` | `System.Globalization.CultureInfo` | Culture info | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes the static method #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Reflection.BindingFlags bindingFlags, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | | `args` | `object[]` | Arguements to the invocation | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes the static method #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to invoke | | `args` | `object[]` | Arguements to the invocation | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes the static method #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Reflection.BindingFlags bindingFlags, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | | `args` | `object[]` | Arguements to the invocation | | `culture` | `System.Globalization.CultureInfo` | Culture | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes the static method #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args, System.Globalization.CultureInfo culture) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to invoke | | `args` | `object[]` | Arguements to the invocation | | `culture` | `System.Globalization.CultureInfo` | Culture | #### Returns Type: `object` Result of invocation ### InvokeStatic Invokes the static method #### Syntax ```csharp theme={"dark"} public object InvokeStatic(string name, System.Reflection.BindingFlags bindingFlags, System.Type[] parameterTypes, object[] args, System.Globalization.CultureInfo culture, System.Type[] typeArguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the member | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the method to invoke | | `args` | `object[]` | Arguements to the invocation | | `culture` | `System.Globalization.CultureInfo` | Culture | | `typeArguments` | `System.Type[]` | An array of types corresponding to the types of the generic arguments. | #### Returns Type: `object` Result of invocation ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetStaticArrayElement Sets the memeber of the static array #### Syntax ```csharp theme={"dark"} public void SetStaticArrayElement(string name, object value, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the array | | `value` | `object` | value to set | | `indices` | `int[]` | A one-dimensional array of 32-bit integers that represent the indexes specifying | | the position of the element to set. For instance, to access a\[10]\[11] the array would be | | | ### SetStaticArrayElement Sets the memeber of the static array #### Syntax ```csharp theme={"dark"} public void SetStaticArrayElement(string name, System.Reflection.BindingFlags bindingFlags, object value, params int[] indices) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the array | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional InvokeHelper attributes | | `value` | `object` | value to set | | `indices` | `int[]` | A one-dimensional array of 32-bit integers that represent the indexes specifying | | the position of the element to set. For instance, to access a\[10]\[11] the array would be | | | ### SetStaticField Sets the static field #### Syntax ```csharp theme={"dark"} public void SetStaticField(string name, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | | `value` | `object` | Arguement to the invocation | ### SetStaticField Sets the static field using binding attributes #### Syntax ```csharp theme={"dark"} public void SetStaticField(string name, System.Reflection.BindingFlags bindingFlags, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional InvokeHelper attributes | | `value` | `object` | Arguement to the invocation | ### SetStaticFieldOrProperty Sets the static field or property #### Syntax ```csharp theme={"dark"} public void SetStaticFieldOrProperty(string name, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | | `value` | `object` | Value to be set to field or property | ### SetStaticFieldOrProperty Sets the static field or property using binding attributes #### Syntax ```csharp theme={"dark"} public void SetStaticFieldOrProperty(string name, System.Reflection.BindingFlags bindingFlags, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the field or property | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes | | `value` | `object` | Value to be set to field or property | ### SetStaticProperty Sets the static property #### Syntax ```csharp theme={"dark"} public void SetStaticProperty(string name, object value, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `value` | `object` | Value to be set to field or property | | `args` | `object[]` | Arguments to pass to the member to invoke. | ### SetStaticProperty Sets the static property #### Syntax ```csharp theme={"dark"} public void SetStaticProperty(string name, object value, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `value` | `object` | Value to be set to field or property | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the indexed property. | | `args` | `object[]` | Arguments to pass to the member to invoke. | ### SetStaticProperty Sets the static property #### Syntax ```csharp theme={"dark"} public void SetStaticProperty(string name, System.Reflection.BindingFlags bindingFlags, object value, params object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes. | | `value` | `object` | Value to be set to field or property | | `args` | `object[]` | Optional index values for indexed properties. The indexes of indexed properties are zero-based. This value should be null for non-indexed properties. | ### SetStaticProperty Sets the static property #### Syntax ```csharp theme={"dark"} public void SetStaticProperty(string name, System.Reflection.BindingFlags bindingFlags, object value, System.Type[] parameterTypes, object[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | Name of the property | | `bindingFlags` | `System.Reflection.BindingFlags` | Additional invocation attributes. | | `value` | `object` | Value to be set to field or property | | `parameterTypes` | `System.Type[]` | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) objects representing the number, order, and type of the parameters for the indexed property. | | `args` | `object[]` | Arguments to pass to the member to invoke. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PublicApiHelpers Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PublicApiHelpers ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.PublicApiHelpers ``` ## Remarks This type originally lived in Microsoft.VisualStudio.TestTools.UnitTesting but was removed from V2. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PublicApiHelpers() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetPublicApiSurfaceReport #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.Dictionary GetPublicApiSurfaceReport(string[] assemblyList) ``` #### Parameters | Name | Type | Description | | - | - | - | | `assemblyList` | `string[]` | - | #### Returns Type: `System.Collections.Generic.Dictionary` ### GetPublicApiSurfaceReport #### Syntax ```csharp theme={"dark"} public static string GetPublicApiSurfaceReport(string assemblyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `assemblyName` | `string` | - | #### Returns Type: `string` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TypeComparer Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/TypeComparer Legacy class used to compare members. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.TypeComparer ``` ## Summary Legacy class used to compare members. ## Remarks Should be rewritten or eliminated at our earliest possible convenience. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TypeComparer() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Compare #### Syntax ```csharp theme={"dark"} public int Compare(object x, object y) ``` #### Parameters | Name | Type | Description | | - | - | - | | `x` | `object` | - | | `y` | `object` | - | #### Returns Type: `int` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.Collections.IComparer # TypeDefinition Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/TypeDefinition ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** CloudNimble.Breakdance.Assemblies **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Assemblies.TypeDefinition ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TypeDefinition(string classDefinition, System.Collections.Generic.List attributes, System.Collections.Generic.List members) ``` #### Parameters | Name | Type | Description | | - | - | - | | `classDefinition` | `string` | - | | `attributes` | `System.Collections.Generic.List` | - | | `members` | `System.Collections.Generic.List` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Attributes A [List\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) containging the full name of each attribute on the type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Attributes { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Members #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Members { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### TypeName The full name of the type member in question. #### Syntax ```csharp theme={"dark"} public string TypeName { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/index Summary of the CloudNimble.Breakdance.Assemblies Namespace ## Types ### Classes | Name | Summary | | - | - | | [AssemblyConstants](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/AssemblyConstants) | | | [BreakdanceManifestGeneratorAttribute](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceManifestGeneratorAttribute) | Tells Breakdance that the attributed method generates a manifest file that is used to test functional outputs. | | [BreakdanceTestAssemblyAttribute](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestAssemblyAttribute) | Tells Breakdance that the attributed method generates a manifest file that is used to test functional outputs. | | [BreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase) | A base class for unit tests that maintains an [IHost](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost) with configuration and a Dependency Injection container. | | [MemberComparer](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/MemberComparer) | Legacy class used to compare members. | | [ObjectTypeComparer](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/ObjectTypeComparer) | Legacy class used to compare types. | | [TypeComparer](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/TypeComparer) | Legacy class used to compare members. | | [MemberDefinition](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/MemberDefinition) | Allows for the storage of metadata information for a specific type member. | | [TypeDefinition](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/TypeDefinition) | | | [PrivateObject](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateObject) | This class represents the live NON public INTERNAL object in the system | | [PrivateType](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PrivateType) | This class represents a private class for the Private Accessor functionality. | | [PublicApiHelpers](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/PublicApiHelpers) | | # AzuriteBreakdanceTestBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteBreakdanceTestBase Base class for tests that require an Azurite instance. Each derived class must declare its own static [AzuriteInstance](/breakdance/api-reference/CloudNimb... ## Definition **Assembly:** CloudNimble.Breakdance.Azurite.dll **Namespace:** CloudNimble.Breakdance.Azurite **Inheritance:** CloudNimble.Breakdance.Assemblies.BreakdanceTestBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Azurite.AzuriteBreakdanceTestBase ``` ## Summary Base class for tests that require an Azurite instance. Each derived class must declare its own static [AzuriteInstance](/api-reference/CloudNimble/Breakdance/Azurite/AzuriteInstance) field and override the `Azurite` property to return it. ## Remarks MSTest requires \[ClassInitialize] and \[ClassCleanup] to be static methods. To avoid cross-class pollution (static fields on a base class are shared by ALL derived classes), each test class must own its own static instance. ## Examples ```csharp theme={"dark"} [TestClass] public class MyTests : AzuriteTestBase { private static AzuriteInstance _azurite; protected override AzuriteInstance Azurite => _azurite; [ClassInitialize] public static async Task ClassInit(TestContext ctx) { _azurite = await CreateAndStartInstanceAsync(new AzuriteConfiguration { Services = AzuriteServiceType.All, InMemoryPersistence = true, Silent = true }); } [ClassCleanup] public static async Task ClassCleanup() { if (_azurite != null) { await _azurite.DisposeAsync(); _azurite = null; } } [TestMethod] public void MyTest() { Assert.IsNotNull(BlobEndpoint); } } ``` ## Properties ### BlobEndpoint Gets the Blob service endpoint URL. #### Syntax ```csharp theme={"dark"} public string BlobEndpoint { get; } ``` #### Property Value Type: `string` ### BlobPort Gets the Blob service port number, or null if not started. #### Syntax ```csharp theme={"dark"} public System.Nullable BlobPort { get; } ``` #### Property Value Type: `System.Nullable` ### ConnectionString Gets a connection string for the Azurite Development Storage account. #### Syntax ```csharp theme={"dark"} public string ConnectionString { get; } ``` #### Property Value Type: `string` ### QueueEndpoint Gets the Queue service endpoint URL. #### Syntax ```csharp theme={"dark"} public string QueueEndpoint { get; } ``` #### Property Value Type: `string` ### QueuePort Gets the Queue service port number, or null if not started. #### Syntax ```csharp theme={"dark"} public System.Nullable QueuePort { get; } ``` #### Property Value Type: `System.Nullable` ### TableEndpoint Gets the Table service endpoint URL. #### Syntax ```csharp theme={"dark"} public string TableEndpoint { get; } ``` #### Property Value Type: `string` ### TablePort Gets the Table service port number, or null if not started. #### Syntax ```csharp theme={"dark"} public System.Nullable TablePort { get; } ``` #### Property Value Type: `System.Nullable` # AzuriteConfiguration Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteConfiguration Configuration options for an Azurite instance. ## Definition **Assembly:** CloudNimble.Breakdance.Azurite.dll **Namespace:** CloudNimble.Breakdance.Azurite **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Azurite.AzuriteConfiguration ``` ## Summary Configuration options for an Azurite instance. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public AzuriteConfiguration() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AutoAssignPorts Gets or sets whether to automatically assign random ports when ports are not specified. When true and ports are null, random ports in 20000-30000 range will be assigned. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool AutoAssignPorts { get; set; } ``` #### Property Value Type: `bool` ### BlobPort Gets or sets the optional blob service port. If null, Azurite will use its default port and we'll parse the actual port from output. #### Syntax ```csharp theme={"dark"} public System.Nullable BlobPort { get; set; } ``` #### Property Value Type: `System.Nullable` ### DebugLogPath Gets or sets the debug log file path. Null means no debug logging. #### Syntax ```csharp theme={"dark"} public string DebugLogPath { get; set; } ``` #### Property Value Type: `string` ### DisableTelemetry Gets or sets whether to disable telemetry. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool DisableTelemetry { get; set; } ``` #### Property Value Type: `bool` ### ExtentMemoryLimitMB Gets or sets the maximum memory limit in MB for in-memory storage. Null means unlimited. Only applies when [AzuriteConfiguration.InMemoryPersistence](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteConfiguration#inmemorypersistence) is true. #### Syntax ```csharp theme={"dark"} public System.Nullable ExtentMemoryLimitMB { get; set; } ``` #### Property Value Type: `System.Nullable` ### InMemoryPersistence Gets or sets whether to use in-memory persistence (no disk storage). Defaults to true. #### Syntax ```csharp theme={"dark"} public bool InMemoryPersistence { get; set; } ``` #### Property Value Type: `bool` ### InstanceName Gets or sets a name to identify this Azurite instance (e.g., test class name). Used for process identification and debugging. The full window title will be "Breakdance.Azurite - ". If not set, defaults to "Unknown". #### Syntax ```csharp theme={"dark"} public string InstanceName { get; set; } ``` #### Property Value Type: `string` ### Location Gets or sets the workspace location for disk persistence. Only used when [AzuriteConfiguration.InMemoryPersistence](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteConfiguration#inmemorypersistence) is false. #### Syntax ```csharp theme={"dark"} public string Location { get; set; } ``` #### Property Value Type: `string` ### LooseMode Gets or sets whether to enable loose mode (ignore unsupported headers/parameters). Defaults to false. #### Syntax ```csharp theme={"dark"} public bool LooseMode { get; set; } ``` #### Property Value Type: `bool` ### MaxRetries Gets or sets the maximum number of retry attempts when port conflicts occur. Only applies when [AzuriteConfiguration.AutoAssignPorts](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteConfiguration#autoassignports) is true. Defaults to 20. #### Syntax ```csharp theme={"dark"} public int MaxRetries { get; set; } ``` #### Property Value Type: `int` ### QueuePort Gets or sets the optional queue service port. If null, Azurite will use its default port and we'll parse the actual port from output. #### Syntax ```csharp theme={"dark"} public System.Nullable QueuePort { get; set; } ``` #### Property Value Type: `System.Nullable` ### Services Gets or sets which services to start. Defaults to [AzuriteServiceType.All](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteServiceType#all). #### Syntax ```csharp theme={"dark"} public CloudNimble.Breakdance.Azurite.AzuriteServiceType Services { get; set; } ``` #### Property Value Type: `CloudNimble.Breakdance.Azurite.AzuriteServiceType` ### Silent Gets or sets whether to run in silent mode (no access logs). Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Silent { get; set; } ``` #### Property Value Type: `bool` ### SkipApiVersionCheck Gets or sets whether to skip API version checking. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool SkipApiVersionCheck { get; set; } ``` #### Property Value Type: `bool` ### StartupTimeoutSeconds Gets or sets the timeout in seconds to wait for Azurite to start. Defaults to 30 seconds. #### Syntax ```csharp theme={"dark"} public int StartupTimeoutSeconds { get; set; } ``` #### Property Value Type: `int` ### TablePort Gets or sets the optional table service port. If null, Azurite will use its default port and we'll parse the actual port from output. #### Syntax ```csharp theme={"dark"} public System.Nullable TablePort { get; set; } ``` #### Property Value Type: `System.Nullable` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # AzuriteInstance Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteInstance Represents a running Azurite instance with process lifecycle management. ## Definition **Assembly:** CloudNimble.Breakdance.Azurite.dll **Namespace:** CloudNimble.Breakdance.Azurite **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Azurite.AzuriteInstance ``` ## Summary Represents a running Azurite instance with process lifecycle management. ## Constructors ### .ctor Creates a new [AzuriteInstance](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteInstance) with the specified configuration. #### Syntax ```csharp theme={"dark"} public AzuriteInstance(CloudNimble.Breakdance.Azurite.AzuriteConfiguration configuration = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `configuration` | `CloudNimble.Breakdance.Azurite.AzuriteConfiguration` | The configuration options. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BlobEndpoint Gets the HTTP endpoint URL for the Blob service. Returns null if Blob service was not requested or not started. #### Syntax ```csharp theme={"dark"} public string BlobEndpoint { get; } ``` #### Property Value Type: `string` ### BlobPort Gets the port number for the Blob service, or null if not started. #### Syntax ```csharp theme={"dark"} public System.Nullable BlobPort { get; private set; } ``` #### Property Value Type: `System.Nullable` ### IsRunning Gets whether the Azurite instance is currently running. #### Syntax ```csharp theme={"dark"} public bool IsRunning { get; } ``` #### Property Value Type: `bool` ### QueueEndpoint Gets the HTTP endpoint URL for the Queue service. Returns null if Queue service was not requested or not started. #### Syntax ```csharp theme={"dark"} public string QueueEndpoint { get; } ``` #### Property Value Type: `string` ### QueuePort Gets the port number for the Queue service, or null if not started. #### Syntax ```csharp theme={"dark"} public System.Nullable QueuePort { get; private set; } ``` #### Property Value Type: `System.Nullable` ### StandardError Gets the standard error captured from the Azurite process. #### Syntax ```csharp theme={"dark"} public string StandardError { get; } ``` #### Property Value Type: `string` ### StandardOutput Gets the standard output captured from the Azurite process. #### Syntax ```csharp theme={"dark"} public string StandardOutput { get; } ``` #### Property Value Type: `string` ### TableEndpoint Gets the HTTP endpoint URL for the Table service. Returns null if Table service was not requested or not started. #### Syntax ```csharp theme={"dark"} public string TableEndpoint { get; } ``` #### Property Value Type: `string` ### TablePort Gets the port number for the Table service, or null if not started. #### Syntax ```csharp theme={"dark"} public System.Nullable TablePort { get; private set; } ``` #### Property Value Type: `System.Nullable` ## Methods ### ClearAllBlobContainersAsync Deletes all blob containers in the storage account. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ClearAllBlobContainersAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task that completes when all containers are deleted. ### ClearAllQueuesAsync Deletes all queues in the storage account. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ClearAllQueuesAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task that completes when all queues are deleted. ### ClearAllTablesAsync Deletes all tables in the storage account. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ClearAllTablesAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task that completes when all tables are deleted. ### ClearQueueMessagesAsync Clears all messages from a queue. Does nothing if the queue doesn't exist. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ClearQueueMessagesAsync(string queueName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `queueName` | `string` | The name of the queue to clear. | #### Returns Type: `System.Threading.Tasks.Task` A task that completes when the operation finishes. ### DeleteBlobContainerAsync Deletes a blob container. Does nothing if the container doesn't exist. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteBlobContainerAsync(string containerName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `containerName` | `string` | The name of the container to delete. | #### Returns Type: `System.Threading.Tasks.Task` A task that completes when the operation finishes. ### DeleteQueueAsync Deletes a queue. Does nothing if the queue doesn't exist. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteQueueAsync(string queueName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `queueName` | `string` | The name of the queue to delete. | #### Returns Type: `System.Threading.Tasks.Task` A task that completes when the operation finishes. ### DeleteTableAsync Deletes a table. Does nothing if the table doesn't exist. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteTableAsync(string tableName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tableName` | `string` | The name of the table to delete. | #### Returns Type: `System.Threading.Tasks.Task` A task that completes when the operation finishes. ### Dispose Disposes the Azurite instance and releases all resources. #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### DisposeAsync Asynchronously disposes the Azurite instance and releases all resources. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.ValueTask DisposeAsync() ``` #### Returns Type: `System.Threading.Tasks.ValueTask` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetConnectionString Gets a connection string for the Development Storage account. Only includes endpoints for services that were requested. #### Syntax ```csharp theme={"dark"} public string GetConnectionString(string accountName = "devstoreaccount1", string accountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==") ``` #### Parameters | Name | Type | Description | | - | - | - | | `accountName` | `string` | The account name. Defaults to "devstoreaccount1". | | `accountKey` | `string` | The account key. Defaults to the well-known development key. | #### Returns Type: `string` A connection string that can be used with Azure Storage SDKs. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### ListBlobContainersAsync Lists all blob containers in the storage account. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> ListBlobContainersAsync() ``` #### Returns Type: `System.Threading.Tasks.Task>` A list of container names. ### ListQueuesAsync Lists all queues in the storage account. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> ListQueuesAsync() ``` #### Returns Type: `System.Threading.Tasks.Task>` A list of queue names. ### ListTablesAsync Lists all tables in the storage account. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> ListTablesAsync() ``` #### Returns Type: `System.Threading.Tasks.Task>` A list of table names. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### StartAsync Starts the Azurite instance asynchronously. Includes automatic retry logic for port conflicts when [AzuriteConfiguration.AutoAssignPorts](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteConfiguration#autoassignports) is true. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task StartAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task that completes when Azurite is ready to accept connections. ### StopAsync Stops the Azurite instance asynchronously. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task StopAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` A task that completes when Azurite has stopped. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IDisposable * System.IAsyncDisposable # AzuriteServiceType Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteServiceType Specifies which Azurite services to start. ## Definition **Assembly:** CloudNimble.Breakdance.Azurite.dll **Namespace:** CloudNimble.Breakdance.Azurite **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Azurite.AzuriteServiceType ``` ## Summary Specifies which Azurite services to start. ## Values | Name | Value | Description | | - | - | - | | `None` | 0 | No services (invalid). | | `Blob` | 1 | Azure Blob Storage emulator. | | `Queue` | 2 | Azure Queue Storage emulator. | | `Table` | 4 | Azure Table Storage emulator. | | `All` | 7 | All services (Blob, Queue, and Table). | # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Azurite/index Summary of the CloudNimble.Breakdance.Azurite Namespace ## Types ### Classes | Name | Summary | | - | - | | [AzuriteBreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteBreakdanceTestBase) | Base class for tests that require an Azurite instance. Each derived class must declare its own static [AzuriteInstance](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteInstance) field and override the `Azurite` property to return it. | | [AzuriteConfiguration](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteConfiguration) | Configuration options for an Azurite instance. | | [AzuriteInstance](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteInstance) | Represents a running Azurite instance with process lifecycle management. | | [AzuriteServiceType](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteServiceType) | Specifies which Azurite services to start. | ### Enums | Name | Summary | | - | - | | [AzuriteServiceType](/breakdance/api-reference/CloudNimble/Breakdance/Azurite/AzuriteServiceType) | Specifies which Azurite services to start. | # BlazorBreakdanceTestBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase A base class for building BUnit unit tests for Blazor apps that automatically handles basic registration stuff for you. ## Definition **Assembly:** CloudNimble.Breakdance.Blazor.dll **Namespace:** CloudNimble.Breakdance.Blazor **Inheritance:** CloudNimble.Breakdance.Assemblies.BreakdanceTestBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Blazor.BlazorBreakdanceTestBase ``` ## Summary A base class for building BUnit unit tests for Blazor apps that automatically handles basic registration stuff for you. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BlazorBreakdanceTestBase() ``` ## Properties ### BUnitTestContext The bUnit `BunitContext` for the currently-executing test. #### Syntax ```csharp theme={"dark"} public Bunit.BunitContext BUnitTestContext { get; set; } ``` #### Property Value Type: `Bunit.BunitContext` ## Methods ### GetService Override Get service of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public override T GetService() where T : class ``` #### Returns Type: `T` A service object of type *T*. #### Type Parameters * `T` - The type of service object to get. ### GetServices Override Get an enumeration of services of type *T* from the System.IServiceProvider. #### Syntax ```csharp theme={"dark"} public override System.Collections.Generic.IEnumerable GetServices() where T : class ``` #### Returns Type: `System.Collections.Generic.IEnumerable` An enumeration of services of type *T*. #### Type Parameters * `T` - The type of service object to get. ### TestSetup Override Properly instantiates the [BlazorBreakdanceTestBase.BUnitTestContext](/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase#bunittestcontext) and registers the [BreakdanceTestBase.TestHost](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#testhost)TestHost's\[Services](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost.services) as a "fallback" [IServiceProvider](/breakdance/api-reference/System/IServiceProvider). #### Syntax ```csharp theme={"dark"} public override void TestSetup() ``` ### TestSetup Properly instantiates the [BlazorBreakdanceTestBase.BUnitTestContext](/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase#bunittestcontext) and registers the [BreakdanceTestBase.TestHost](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#testhost)TestHost's\[Services](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost.services) as a "fallback" [IServiceProvider](/breakdance/api-reference/System/IServiceProvider) and allows you to set the bUnit JSInterop mode. #### Syntax ```csharp theme={"dark"} public void TestSetup(Bunit.JSRuntimeMode jSRuntimeMode) ``` #### Parameters | Name | Type | Description | | - | - | - | | `jSRuntimeMode` | `Bunit.JSRuntimeMode` | - | ### TestTearDown Override Disposes of the [BlazorBreakdanceTestBase.BUnitTestContext](/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase#bunittestcontext). #### Syntax ```csharp theme={"dark"} public override void TestTearDown() ``` # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Blazor/index Summary of the CloudNimble.Breakdance.Blazor Namespace ## Types ### Classes | Name | Summary | | - | - | | [BlazorBreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase) | A base class for building BUnit unit tests for Blazor apps that automatically handles basic registration stuff for you. | # DotHttpAssertionException Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException Exception thrown when a DotHttp assertion fails. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.DotHttpAssertionException ``` ## Summary Exception thrown when a DotHttp assertion fails. ## Remarks This exception is thrown by [DotHttpAssertions](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertions) methods when HTTP response validation fails. ## Examples ```csharp theme={"dark"} try { await DotHttpAssertions.AssertValidResponseAsync(response); } catch (DotHttpAssertionException ex) { Console.WriteLine($"Assertion failed: {ex.Message}"); } ``` ## Constructors ### .ctor Initializes a new instance of the [DotHttpAssertionException](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException) class. #### Syntax ```csharp theme={"dark"} public DotHttpAssertionException() ``` ### .ctor Initializes a new instance of the [DotHttpAssertionException](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException) class with a specified error message. #### Syntax ```csharp theme={"dark"} public DotHttpAssertionException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | The message that describes the error. | ### .ctor Initializes a new instance of the [DotHttpAssertionException](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException) class with a specified error message and inner exception. #### Syntax ```csharp theme={"dark"} public DotHttpAssertionException(string message, System.Exception innerException) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | The message that describes the error. | | `innerException` | `System.Exception` | The exception that is the cause of the current exception. | # DotHttpAssertions Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertions Provides smart assertion helpers for HTTP responses that go beyond simple status code checking. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.DotHttpAssertions ``` ## Summary Provides smart assertion helpers for HTTP responses that go beyond simple status code checking. ## Remarks Detects common API error patterns like 200 OK responses that contain error payloads. ## Examples ```csharp theme={"dark"} var response = await httpClient.SendAsync(request); // Validate response meets common API expectations await DotHttpAssertions.AssertValidResponseAsync(response); // Or with custom options await DotHttpAssertions.AssertValidResponseAsync(response, checkStatusCode: true, checkContentType: true, checkBodyForErrors: true); ``` ## Methods ### AssertBodyContainsAsync Validates that the response body contains the specified text. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task AssertBodyContainsAsync(System.Net.Http.HttpResponseMessage response, string expectedText, int maxBodyPreviewLength = 500) ``` #### Parameters | Name | Type | Description | | - | - | - | | `response` | `System.Net.Http.HttpResponseMessage` | The HTTP response. | | `expectedText` | `string` | The text that should be present in the body. | | `maxBodyPreviewLength` | `int` | Maximum length of body content to include in error messages. | #### Returns Type: `System.Threading.Tasks.Task` #### Examples ```csharp theme={"dark"} await DotHttpAssertions.AssertBodyContainsAsync(response, "\"success\":true"); ``` ### AssertContentType Validates that the response Content-Type matches the expected value. #### Syntax ```csharp theme={"dark"} public static void AssertContentType(System.Net.Http.HttpResponseMessage response, string expectedContentType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `response` | `System.Net.Http.HttpResponseMessage` | The HTTP response. | | `expectedContentType` | `string` | The expected Content-Type (e.g., "application/json"). | #### Examples ```csharp theme={"dark"} DotHttpAssertions.AssertContentType(response, "application/json"); ``` ### AssertHeader Validates that the response contains a specific header. #### Syntax ```csharp theme={"dark"} public static void AssertHeader(System.Net.Http.HttpResponseMessage response, string headerName, string expectedValue = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `response` | `System.Net.Http.HttpResponseMessage` | The HTTP response. | | `headerName` | `string` | The expected header name. | | `expectedValue` | `string` | Optional expected header value. | #### Examples ```csharp theme={"dark"} DotHttpAssertions.AssertHeader(response, "X-Request-Id"); DotHttpAssertions.AssertHeader(response, "Cache-Control", "no-store"); ``` ### AssertNoErrorsInBodyAsync Validates that the response body does not contain error patterns. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task AssertNoErrorsInBodyAsync(System.Net.Http.HttpResponseMessage response, int maxBodyPreviewLength = 500) ``` #### Parameters | Name | Type | Description | | - | - | - | | `response` | `System.Net.Http.HttpResponseMessage` | The HTTP response. | | `maxBodyPreviewLength` | `int` | Maximum length of body content to include in error messages. | #### Returns Type: `System.Threading.Tasks.Task` #### Examples ```csharp theme={"dark"} await DotHttpAssertions.AssertNoErrorsInBodyAsync(response); ``` ### AssertStatusCodeAsync Validates that the response status code matches the expected value. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task AssertStatusCodeAsync(System.Net.Http.HttpResponseMessage response, int expectedStatusCode, int maxBodyPreviewLength = 500) ``` #### Parameters | Name | Type | Description | | - | - | - | | `response` | `System.Net.Http.HttpResponseMessage` | The HTTP response. | | `expectedStatusCode` | `int` | The expected status code. | | `maxBodyPreviewLength` | `int` | Maximum length of body content to include in error messages. | #### Returns Type: `System.Threading.Tasks.Task` #### Examples ```csharp theme={"dark"} await DotHttpAssertions.AssertStatusCodeAsync(response, 201); // Created await DotHttpAssertions.AssertStatusCodeAsync(response, 204); // No Content ``` ### AssertValidResponseAsync Validates that the response meets common API contract expectations. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task AssertValidResponseAsync(System.Net.Http.HttpResponseMessage response, bool checkStatusCode = true, bool checkContentType = true, bool checkBodyForErrors = true, bool logResponseOnFailure = true, int maxBodyPreviewLength = 500) ``` #### Parameters | Name | Type | Description | | - | - | - | | `response` | `System.Net.Http.HttpResponseMessage` | The HTTP response to validate. | | `checkStatusCode` | `bool` | Whether to check the status code for success. Default is true. | | `checkContentType` | `bool` | Whether to verify Content-Type is present when body exists. Default is true. | | `checkBodyForErrors` | `bool` | Whether to check for error patterns in the response body. Default is true. | | `logResponseOnFailure` | `bool` | Whether to include the response body in failure messages. Default is true. | | `maxBodyPreviewLength` | `int` | Maximum length of body content to include in error messages. Default is 500. | #### Returns Type: `System.Threading.Tasks.Task` A task that completes when validation is done. #### Exceptions | Exception | Description | | - | - | | `DotHttpAssertionException` | Thrown when an assertion fails. | #### Examples ```csharp theme={"dark"} var response = await httpClient.SendAsync(request); await DotHttpAssertions.AssertValidResponseAsync(response); ``` # DotHttpFileParser Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpFileParser Parses .http files into structured [DotHttpFile](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpFile) objects. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.DotHttpFileParser ``` ## Summary Parses .http files into structured [DotHttpFile](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpFile) objects. ## Remarks Implements the full .http file specification as documented at [https://learn.microsoft.com/en-us/aspnet/core/test/http-files](https://learn.microsoft.com/en-us/aspnet/core/test/http-files) including variables, request chaining, file references, and multi-line headers. ## Examples ```csharp theme={"dark"} var parser = new DotHttpFileParser(); var file = parser.Parse(httpFileContent, "api.http"); // Check for parse diagnostics foreach (var diagnostic in file.Diagnostics) { Console.WriteLine($"{diagnostic.Location}: {diagnostic.GetMessage()}"); } // Process requests foreach (var request in file.Requests) { Console.WriteLine($"{request.Method} {request.Url}"); } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DotHttpFileParser() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### Parse Parses a .http file content into a structured model. #### Syntax ```csharp theme={"dark"} public CloudNimble.Breakdance.DotHttp.Models.DotHttpFile Parse(string content, string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `content` | `string` | The content of the .http file. | | `filePath` | `string` | The file path for reference in the model. | #### Returns Type: `CloudNimble.Breakdance.DotHttp.Models.DotHttpFile` A [DotHttpFile](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpFile) containing the parsed requests, variables, and any parse errors. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *filePath* is null. | #### Examples ```csharp theme={"dark"} var parser = new DotHttpFileParser(); var content = File.ReadAllText("api.http"); var file = parser.Parse(content, "api.http"); ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DotHttpTestBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpTestBase Base class for generated .http file tests. Provides HTTP client management, variable resolution, and response capture for request chaining. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp **Inheritance:** CloudNimble.Breakdance.Assemblies.BreakdanceTestBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.DotHttpTestBase ``` ## Summary Base class for generated .http file tests. Provides HTTP client management, variable resolution, and response capture for request chaining. ## Remarks Inherits from BreakdanceTestBase for integration with the Breakdance testing framework. Generated test classes are partial, allowing customization of setup and assertions. ## Examples ```csharp theme={"dark"} public partial class ApiTests : DotHttpTestBase { protected override HttpMessageHandler CreateHttpMessageHandler() { // Use cached responses for deterministic tests return new TestCacheReadDelegatingHandler("ResponseFiles"); } partial void OnLoginSetup() { SetVariable("baseUrl", "https://api.example.com"); } } ``` ## Methods ### LoadEnvironment Loads environment configuration from an http-client.env.json file. #### Syntax ```csharp theme={"dark"} public void LoadEnvironment(string filePath, string environmentName = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The path to the environment file. | | `environmentName` | `string` | The environment to use (e.g., "dev", "staging"). | #### Examples ```csharp theme={"dark"} LoadEnvironment("http-client.env.json", "dev"); // Now variables from the dev environment are available ``` ### LoadEnvironmentWithOverrides Loads environment configuration with user overrides. #### Syntax ```csharp theme={"dark"} public void LoadEnvironmentWithOverrides(string baseFilePath, string userFilePath, string environmentName = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `baseFilePath` | `string` | The path to the http-client.env.json file. | | `userFilePath` | `string` | The path to the http-client.env.json.user file. | | `environmentName` | `string` | The environment to use. | #### Examples ```csharp theme={"dark"} LoadEnvironmentWithOverrides( "http-client.env.json", "http-client.env.json.user", "dev"); ``` ### SetVariable Sets a variable for use in request resolution. #### Syntax ```csharp theme={"dark"} public void SetVariable(string name, string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The variable name (without @ prefix or wrapper). | | `value` | `string` | The variable value. | #### Examples ```csharp theme={"dark"} SetVariable("baseUrl", "https://api.example.com"); SetVariable("apiKey", "my-secret-key"); ``` ### SwitchEnvironment Switches to a different environment from the loaded configuration. #### Syntax ```csharp theme={"dark"} public void SwitchEnvironment(string environmentName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `environmentName` | `string` | The environment name to switch to. | #### Examples ```csharp theme={"dark"} LoadEnvironment("http-client.env.json", "dev"); // Run dev tests... SwitchEnvironment("staging"); // Now running with staging variables ``` ### TestSetupAsync Override Sets up the test environment. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task TestSetupAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` ### TestTearDownAsync Override Cleans up resources after each test. #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task TestTearDownAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` # EnvironmentLoader Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/EnvironmentLoader Loads and parses http-client.env.json environment files. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.EnvironmentLoader ``` ## Summary Loads and parses http-client.env.json environment files. ## Remarks Supports \$shared variables, environment-specific values, provider-based secrets, and .user file overrides. ## Examples ```csharp theme={"dark"} var loader = new EnvironmentLoader(); var environment = loader.LoadFromFile("http-client.env.json"); var variables = loader.GetResolvedVariables(environment, "dev"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EnvironmentLoader() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetResolvedVariables Gets the resolved variables for a specific environment, including \$shared values. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary GetResolvedVariables(CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment environment, string environmentName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `environment` | `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment` | The environment configuration. | | `environmentName` | `string` | The name of the environment (e.g., "dev", "staging"). | #### Returns Type: `System.Collections.Generic.Dictionary` A dictionary of resolved variable names and values. #### Examples ```csharp theme={"dark"} var loader = new EnvironmentLoader(); var env = loader.LoadFromFile("http-client.env.json"); var devVars = loader.GetResolvedVariables(env, "dev"); // devVars contains merged $shared and dev-specific variables ``` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### LoadFromFile Loads an environment configuration from a JSON file path. #### Syntax ```csharp theme={"dark"} public CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment LoadFromFile(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The path to the http-client.env.json file. | #### Returns Type: `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment` A [DotHttpEnvironment](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpEnvironment) containing the parsed configuration. #### Examples ```csharp theme={"dark"} var loader = new EnvironmentLoader(); var environment = loader.LoadFromFile("http-client.env.json"); foreach (var envName in environment.Environments.Keys) { Console.WriteLine($"Environment: {envName}"); } ``` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWithUserOverrides Merges the user override file (.user) with the base environment. #### Syntax ```csharp theme={"dark"} public CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment MergeWithUserOverrides(CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment baseEnvironment, string userFilePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `baseEnvironment` | `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment` | The base environment from http-client.env.json. | | `userFilePath` | `string` | The path to the http-client.env.json.user file. | #### Returns Type: `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment` The merged environment configuration. #### Examples ```csharp theme={"dark"} var loader = new EnvironmentLoader(); var baseEnv = loader.LoadFromFile("http-client.env.json"); var mergedEnv = loader.MergeWithUserOverrides(baseEnv, "http-client.env.json.user"); ``` #### Remarks User override values take precedence over base environment values. ### Parse Parses environment configuration from JSON content. #### Syntax ```csharp theme={"dark"} public CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment Parse(string jsonContent) ``` #### Parameters | Name | Type | Description | | - | - | - | | `jsonContent` | `string` | The JSON content of the environment file. | #### Returns Type: `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment` A [DotHttpEnvironment](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpEnvironment) containing the parsed configuration. #### Examples ```csharp theme={"dark"} var loader = new EnvironmentLoader(); var json = @"{ ""$shared"": { ""ApiVersion"": ""v2"" }, ""dev"": { ""HostAddress"": ""https://localhost:5001"" } }"; var environment = loader.Parse(json); ``` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DotHttpSourceGenerator Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Generator/DotHttpSourceGenerator Source generator that creates test classes from .http files. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp.Generator **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.Generator.DotHttpSourceGenerator ``` ## Summary Source generator that creates test classes from .http files. ## Remarks Supports MSTest and XUnit frameworks via the TestFramework configuration property. Generated classes are partial to allow custom setup and assertion overrides. ## Examples ```csharp theme={"dark"} // Given an api.http file with: // @baseUrl = https://api.example.com // // ### Get all users // # @name GetAllUsers // GET {{baseUrl}}/users // Accept: application/json // // The generator produces ApiTests.g.cs with: // [TestClass] // public partial class ApiTests : DotHttpTestBase // { // [TestMethod] // public async Task GetAllUsers() { ... } // } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DotHttpSourceGenerator() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Initialize #### Syntax ```csharp theme={"dark"} public void Initialize(Microsoft.CodeAnalysis.IncrementalGeneratorInitializationContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.CodeAnalysis.IncrementalGeneratorInitializationContext` | - | ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.CodeAnalysis.IIncrementalGenerator # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Generator/index Summary of the CloudNimble.Breakdance.DotHttp.Generator Namespace ## Types ### Classes | Name | Summary | | - | - | | [DotHttpSourceGenerator](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Generator/DotHttpSourceGenerator) | Source generator that creates test classes from .http files. | # DotHttpEnvironment Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpEnvironment Represents the configuration from an http-client.env.json file. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment ``` ## Summary Represents the configuration from an http-client.env.json file. ## Remarks Supports \$shared variables, environment-specific values, and provider-based secrets. ## Examples ```csharp theme={"dark"} { "$shared": { "ApiVersion": "v2" }, "dev": { "HostAddress": "https://localhost:5001" }, "prod": { "HostAddress": "https://api.example.com" } } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DotHttpEnvironment() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Environments Gets or sets the environment-specific variable sets, keyed by environment name. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> Environments { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` #### Remarks Common environment names include "dev", "staging", and "prod". ### Shared Gets or sets the shared variables that apply to all environments. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Shared { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` #### Remarks Parsed from the "\$shared" section in http-client.env.json. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DotHttpFile Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpFile Represents a complete parsed .http file containing variables and requests. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.Models.DotHttpFile ``` ## Summary Represents a complete parsed .http file containing variables and requests. ## Remarks A .http file can contain multiple requests separated by ### and file-level variables. Variables are case-sensitive per the Microsoft specification. ## Examples ```csharp theme={"dark"} @baseUrl = https://api.example.com ### Get all users GET {{baseUrl}}/users ### Create user POST {{baseUrl}}/users Content-Type: application/json {"name": "John"} ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DotHttpFile() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Diagnostics Gets or sets the parsing diagnostics encountered while parsing this file. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Diagnostics { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks Contains Roslyn diagnostic information for malformed content that could not be parsed. ### FilePath Gets or sets the file path relative to the project. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string` ### HasChainedRequests Gets a value indicating whether any requests in this file have dependencies on other requests. #### Syntax ```csharp theme={"dark"} public bool HasChainedRequests { get; } ``` #### Property Value Type: `bool` #### Remarks Returns true when any request uses response variable references like `{{login.response.body.$.token}}`. ### Requests Gets or sets all HTTP requests defined in the file. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Requests { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks Requests are separated by ### in the source file. ### Variables Gets or sets the file-level variables defined with @name=value syntax. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Variables { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` #### Examples ```csharp theme={"dark"} @baseUrl = https://api.example.com @apiVersion = v2 ``` #### Remarks Variable names are case-sensitive per the Microsoft specification. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DotHttpRequest Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpRequest Represents a single HTTP request parsed from a .http file. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.Models.DotHttpRequest ``` ## Summary Represents a single HTTP request parsed from a .http file. ## Remarks Supports all standard HTTP methods, request chaining via response variable references, file-based request bodies, and request-level variable overrides. ## Examples ```csharp theme={"dark"} # @name GetUsers GET {{baseUrl}}/users Accept: application/json Authorization: Bearer {{login.response.body.$.token}} ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DotHttpRequest() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Body Gets or sets the request body content for POST, PUT, and PATCH requests. #### Syntax ```csharp theme={"dark"} public string Body { get; set; } ``` #### Property Value Type: `string` #### Remarks May contain references that are resolved at runtime. For file references, this will be null and [DotHttpRequest.BodyFilePath](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpRequest#bodyfilepath) will be set. ### BodyFilePath Gets or sets the file path for request body when using file reference syntax. #### Syntax ```csharp theme={"dark"} public string BodyFilePath { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} POST {{baseUrl}}/upload Content-Type: application/octet-stream < ./path/to/file.bin ``` #### Remarks When set, the body content should be loaded from this file path at runtime. The path is relative to the .http file location. ### Comments Gets or sets the comments and documentation that appeared before this request. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Comments { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks Comments are parsed from lines starting with # or // that precede the request line. The comment markers are preserved for accurate representation. ### DependsOn Gets or sets the names of requests this request depends on for chaining. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DependsOn { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Examples ```csharp theme={"dark"} // A request using {{login.response.body.$.token}} would have "login" in DependsOn ``` ### HasResponseReferences Gets a value indicating whether this request references variables from previous responses. #### Syntax ```csharp theme={"dark"} public bool HasResponseReferences { get; set; } ``` #### Property Value Type: `bool` #### Examples ```csharp theme={"dark"} // True when the request contains syntax like {{login.response.body.$.token}} ``` ### Headers Gets or sets the request headers as key-value pairs. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Headers { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` #### Remarks Headers are stored with case-insensitive keys per RFC 7230. Header values may contain references that are resolved at runtime. ### HttpVersion Gets or sets the HTTP version (HTTP/1.1, HTTP/2, HTTP/3). #### Syntax ```csharp theme={"dark"} public string HttpVersion { get; set; } ``` #### Property Value Type: `string` #### Remarks Optional. When not specified, the default HTTP version is used. ### IsFileBody Gets a value indicating whether the request body should be loaded from a file. #### Syntax ```csharp theme={"dark"} public bool IsFileBody { get; } ``` #### Property Value Type: `bool` ### LineNumber Gets or sets the line number in the source file where this request begins. #### Syntax ```csharp theme={"dark"} public int LineNumber { get; set; } ``` #### Property Value Type: `int` #### Remarks Used for diagnostics and error reporting. ### Method Gets or sets the HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE, CONNECT). #### Syntax ```csharp theme={"dark"} public string Method { get; set; } ``` #### Property Value Type: `string` ### Name Gets or sets the optional name for the request, parsed from "# @name RequestName" comment. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` #### Remarks Used for generating test method names and for referencing in request chaining. ### SeparatorTitle Gets or sets the text that appeared after the ### separator on the same line. #### Syntax ```csharp theme={"dark"} public string SeparatorTitle { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} ### Get All Users GET {{baseUrl}}/users ``` #### Remarks This text is used for generating descriptive test method names when @name is not specified. ### Url Gets or sets the request URL. #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string` #### Remarks May contain references that are resolved at runtime. ### Variables Gets or sets the request-level variables that override file-level variables. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Variables { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` #### Examples ```csharp theme={"dark"} @baseUrl = https://override.example.com GET {{baseUrl}}/users ``` #### Remarks Variables defined after a request separator (###) but before the next request line apply only to that request and override file-level variables with the same name. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EnvironmentValue Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/EnvironmentValue Represents a value in the environment configuration. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.Models.EnvironmentValue ``` ## Summary Represents a value in the environment configuration. ## Remarks Can be a simple string or a provider-based secret reference (AspnetUserSecrets, AzureKeyVault, etc.). ## Examples ```csharp theme={"dark"} // Simple string value { "ApiKey": "dev-key-123" } // Provider-based secret { "ApiKey": { "provider": "AzureKeyVault", "secretName": "ProdApiKey", "resourceId": "/subscriptions/.../vaults/my-vault" } } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EnvironmentValue() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### IsSecret Gets a value indicating whether this is a provider-based secret. #### Syntax ```csharp theme={"dark"} public bool IsSecret { get; } ``` #### Property Value Type: `bool` #### Remarks Returns true when [EnvironmentValue.Provider](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/EnvironmentValue#provider) is not null or empty. ### Provider Gets or sets the provider type for secret resolution. #### Syntax ```csharp theme={"dark"} public string Provider { get; set; } ``` #### Property Value Type: `string` #### Remarks Supported providers include "AspnetUserSecrets", "AzureKeyVault", and "Encrypted". ### ResourceId Gets or sets the Azure resource ID for the AzureKeyVault provider. #### Syntax ```csharp theme={"dark"} public string ResourceId { get; set; } ``` #### Property Value Type: `string` ### SecretName Gets or sets the secret name for provider-based values. #### Syntax ```csharp theme={"dark"} public string SecretName { get; set; } ``` #### Property Value Type: `string` ### Value Gets or sets the simple string value when not using a provider. #### Syntax ```csharp theme={"dark"} public string Value { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FromString Creates an [EnvironmentValue](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/EnvironmentValue) from a simple string. #### Syntax ```csharp theme={"dark"} public static CloudNimble.Breakdance.DotHttp.Models.EnvironmentValue FromString(string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `value` | `string` | The string value. | #### Returns Type: `CloudNimble.Breakdance.DotHttp.Models.EnvironmentValue` A new [EnvironmentValue](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/EnvironmentValue) with the specified value. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/index Summary of the CloudNimble.Breakdance.DotHttp.Models Namespace ## Types ### Classes | Name | Summary | | - | - | | [DotHttpEnvironment](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpEnvironment) | Represents the configuration from an http-client.env.json file. | | [DotHttpFile](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpFile) | Represents a complete parsed .http file containing variables and requests. | | [DotHttpRequest](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpRequest) | Represents a single HTTP request parsed from a .http file. | | [EnvironmentValue](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/EnvironmentValue) | Represents a value in the environment configuration. | # ResponseCapture Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/ResponseCapture Captures HTTP responses from named requests for use in request chaining. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.ResponseCapture ``` ## Summary Captures HTTP responses from named requests for use in request chaining. ## Remarks Supports `{{name.response.body.$.path}}` for JSONPath, `{{name.response.body./xpath}}` for XPath, and `{{name.response.headers.HeaderName}}` for header extraction. ## Examples ```csharp theme={"dark"} var capture = new ResponseCapture(); await capture.CaptureAsync("login", loginResponse); // Later, resolve a reference from the captured response var token = capture.ResolveReference("{{login.response.body.$.token}}"); var header = capture.ResolveReference("{{login.response.headers.X-Request-Id}}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ResponseCapture() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### CaptureAsync Captures a response for later reference. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CaptureAsync(string name, System.Net.Http.HttpResponseMessage response, string requestBody = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The request name (from # @name directive). | | `response` | `System.Net.Http.HttpResponseMessage` | The HTTP response. | | `requestBody` | `string` | The original request body (for `{{name.request.body}}` references). | #### Returns Type: `System.Threading.Tasks.Task` #### Examples ```csharp theme={"dark"} var capture = new ResponseCapture(); var response = await httpClient.SendAsync(request); await capture.CaptureAsync("createUser", response, requestBodyJson); ``` ### Clear Clears all captured responses. #### Syntax ```csharp theme={"dark"} public void Clear() ``` #### Examples ```csharp theme={"dark"} var capture = new ResponseCapture(); // ... capture some responses ... capture.Clear(); // Reset for new test ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetResponseBody Gets the captured response body for a named request. #### Syntax ```csharp theme={"dark"} public string GetResponseBody(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The request name. | #### Returns Type: `string` The response body, or null if not captured. #### Examples ```csharp theme={"dark"} var capture = new ResponseCapture(); await capture.CaptureAsync("login", response); var body = capture.GetResponseBody("login"); ``` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasResponse Checks if a captured response exists for the given name. #### Syntax ```csharp theme={"dark"} public bool HasResponse(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The request name. | #### Returns Type: `bool` True if the response has been captured. #### Examples ```csharp theme={"dark"} if (capture.HasResponse("login")) { var token = capture.ResolveReference("{{login.response.body.$.token}}"); } ``` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ResolveAllReferences Resolves all response references in a string. #### Syntax ```csharp theme={"dark"} public string ResolveAllReferences(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string containing response references. | #### Returns Type: `string` The resolved string. #### Examples ```csharp theme={"dark"} var url = "https://api.example.com/users/{{login.response.body.$.userId}}"; var resolvedUrl = capture.ResolveAllReferences(url); ``` ### ResolveReference Resolves a response reference to its actual value. #### Syntax ```csharp theme={"dark"} public string ResolveReference(string reference) ``` #### Parameters | Name | Type | Description | | - | - | - | | `reference` | `string` | The full reference string (e.g., `"{{login.response.body.$.token}}"`). | #### Returns Type: `string` The resolved value, or the original reference if not found. #### Examples ```csharp theme={"dark"} var capture = new ResponseCapture(); await capture.CaptureAsync("login", response); var token = capture.ResolveReference("{{login.response.body.$.token}}"); ``` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # VariableResolver Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/VariableResolver Resolves `{{variable}}` placeholders in .http file content. ## Definition **Assembly:** CloudNimble.Breakdance.DotHttp.dll **Namespace:** CloudNimble.Breakdance.DotHttp **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.DotHttp.VariableResolver ``` ## Summary Resolves `{{variable}}` placeholders in .http file content. ## Remarks Supports simple variables, dynamic variables ($datetime, $randomInt, etc.), and response references for request chaining per the Microsoft .http file specification. ## Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); resolver.SetVariable("baseUrl", "https://api.example.com"); resolver.SetVariable("apiKey", "my-secret-key"); var result = resolver.Resolve("GET {{baseUrl}}/users?key={{apiKey}}"); // result = "GET https://api.example.com/users?key=my-secret-key" ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public VariableResolver() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Clear Clears all stored variables. #### Syntax ```csharp theme={"dark"} public void Clear() ``` #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); resolver.SetVariable("foo", "bar"); resolver.Clear(); // All variables are now removed ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetResponseReferenceNames Extracts all response reference names from the input. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet GetResponseReferenceNames(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string. | #### Returns Type: `System.Collections.Generic.HashSet` Set of request names that are referenced. #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); var input = "Authorization: Bearer {{login.response.body.$.token}}"; var names = resolver.GetResponseReferenceNames(input); // names contains "login" ``` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### GetVariableNames Extracts all variable names from the input string. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet GetVariableNames(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string. | #### Returns Type: `System.Collections.Generic.HashSet` Set of variable names found. #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); var input = "{{baseUrl}}/users/{{userId}}"; var names = resolver.GetVariableNames(input); // names contains "baseUrl" and "userId" ``` ### HasResponseReferences Checks if a string contains response references (`{{name.response.*}}`). #### Syntax ```csharp theme={"dark"} public bool HasResponseReferences(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string to check. | #### Returns Type: `bool` True if response references are present. #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); var hasRefs = resolver.HasResponseReferences("Bearer {{login.response.body.$.token}}"); // hasRefs = true ``` ### HasUnresolvedVariables Checks if a string contains any unresolved variable references. #### Syntax ```csharp theme={"dark"} public bool HasUnresolvedVariables(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string to check. | #### Returns Type: `bool` True if unresolved variables remain. #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); resolver.SetVariable("baseUrl", "https://api.example.com"); var resolved = resolver.Resolve("{{baseUrl}}/{{userId}}"); var hasUnresolved = resolver.HasUnresolvedVariables(resolved); // hasUnresolved = true (userId was not set) ``` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Resolve Resolves all variable references in the input string. #### Syntax ```csharp theme={"dark"} public string Resolve(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string containing `{{variable}}` placeholders. | #### Returns Type: `string` The resolved string with variables replaced. #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); resolver.SetVariable("baseUrl", "https://api.example.com"); var result = resolver.Resolve("GET {{baseUrl}}/users"); // result = "GET https://api.example.com/users" ``` ### ResolveDynamicVariables Resolves dynamic variables like $datetime, $randomInt, \$timestamp, etc. #### Syntax ```csharp theme={"dark"} public string ResolveDynamicVariables(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string. | #### Returns Type: `string` The resolved string. #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); var result = resolver.ResolveDynamicVariables("ID: {{$guid}}"); // result = "ID: 550e8400-e29b-41d4-a716-446655440000" (example GUID) ``` ### ResolveSimpleVariables Resolves simple `{{variable}}` placeholders. #### Syntax ```csharp theme={"dark"} public string ResolveSimpleVariables(string input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `input` | `string` | The input string. | #### Returns Type: `string` The resolved string. #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); resolver.SetVariable("name", "John"); var result = resolver.ResolveSimpleVariables("Hello, {{name}}!"); // result = "Hello, John!" ``` ### SetVariable Sets a variable value for resolution. #### Syntax ```csharp theme={"dark"} public void SetVariable(string name, string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The variable name (without @ prefix or wrapper). | | `value` | `string` | The variable value. | #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); resolver.SetVariable("baseUrl", "https://api.example.com"); ``` ### SetVariables Sets multiple variables at once. #### Syntax ```csharp theme={"dark"} public void SetVariables(System.Collections.Generic.IDictionary variables) ``` #### Parameters | Name | Type | Description | | - | - | - | | `variables` | `System.Collections.Generic.IDictionary` | Dictionary of variable names and values. | #### Examples ```csharp theme={"dark"} var resolver = new VariableResolver(); resolver.SetVariables(new Dictionary<string, string> { ["baseUrl"] = "https://api.example.com", ["apiKey"] = "secret-key" }); ``` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/index Summary of the CloudNimble.Breakdance.DotHttp Namespace ## Types ### Classes | Name | Summary | | - | - | | [DotHttpAssertionException](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException) | Exception thrown when a DotHttp assertion fails. | | [DotHttpAssertions](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertions) | Provides smart assertion helpers for HTTP responses that go beyond simple status code checking. | | [DotHttpFileParser](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpFileParser) | Parses .http files into structured [DotHttpFile](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpFile) objects. | | [DotHttpTestBase](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpTestBase) | Base class for generated .http file tests. Provides HTTP client management, variable resolution, and response capture for request chaining. | | [EnvironmentLoader](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/EnvironmentLoader) | Loads and parses http-client.env.json environment files. | | [ResponseCapture](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/ResponseCapture) | Captures HTTP responses from named requests for use in request chaining. | | [VariableResolver](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/VariableResolver) | Resolves `{{variable}}` placeholders in .http file content. | # BreakdanceMSTestBase Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Extensions/MSTest2/BreakdanceMSTestBase A base class for testing that provides an MSTest [BreakdanceMSTestBase.TestContext](/breakdance/api-reference/CloudNimble/Breakdance/Extensions/MSTest2/BreakdanceMSTest... ## Definition **Assembly:** CloudNimble.Breakdance.Extensions.MSTest2.dll **Namespace:** CloudNimble.Breakdance.Extensions.MSTest2 **Inheritance:** CloudNimble.Breakdance.Assemblies.BreakdanceTestBase ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Extensions.MSTest2.BreakdanceMSTestBase ``` ## Summary A base class for testing that provides an MSTest [BreakdanceMSTestBase.TestContext](/api-reference/CloudNimble/Breakdance/Extensions/MSTest2/BreakdanceMSTestBase#testcontext). ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BreakdanceMSTestBase() ``` ## Properties ### TestContext The [BreakdanceMSTestBase.TestContext](/breakdance/api-reference/CloudNimble/Breakdance/Extensions/MSTest2/BreakdanceMSTestBase#testcontext) populated by MSTest during test execution. #### Syntax ```csharp theme={"dark"} public Microsoft.VisualStudio.TestTools.UnitTesting.TestContext TestContext { get; set; } ``` #### Property Value Type: `Microsoft.VisualStudio.TestTools.UnitTesting.TestContext` # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Extensions/MSTest2/index Summary of the CloudNimble.Breakdance.Extensions.MSTest2 Namespace ## Types ### Classes | Name | Summary | | - | - | | [BreakdanceMSTestBase](/breakdance/api-reference/CloudNimble/Breakdance/Extensions/MSTest2/BreakdanceMSTestBase) | A base class for testing that provides an MSTest [BreakdanceMSTestBase.TestContext](/breakdance/api-reference/CloudNimble/Breakdance/Extensions/MSTest2/BreakdanceMSTestBase#testcontext). | # ColorConsole Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Tools/ColorConsole Console Color Helper class that provides coloring to individual commands ## Definition **Assembly:** Breakdance.Tools.dll **Namespace:** CloudNimble.Breakdance.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.Tools.ColorConsole ``` ## Summary Console Color Helper class that provides coloring to individual commands ## Methods ### Write Write with color #### Syntax ```csharp theme={"dark"} public static void Write(string text, System.Nullable color = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | - | | `color` | `System.Nullable` | - | ### Write Writes out a line with color specified as a string #### Syntax ```csharp theme={"dark"} public static void Write(string text, string color) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | Text to write | | `color` | `string` | A console color. Must match ConsoleColors collection names (case insensitive) | ### WriteEmbeddedColorLine Allows a string to be written with embedded color values using: This is \[red]Red\[/red] text and this is \[cyan]Blue\[/cyan] text #### Syntax ```csharp theme={"dark"} public static void WriteEmbeddedColorLine(string text, System.Nullable baseTextColor = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | Text to display | | `baseTextColor` | `System.Nullable` | Base text color | ### WriteError Write a Error Line - Red #### Syntax ```csharp theme={"dark"} public static void WriteError(string text) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | Text to write out | ### WriteInfo Write a Info Line - dark cyan #### Syntax ```csharp theme={"dark"} public static void WriteInfo(string text) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | Text to write out | ### WriteLine WriteLine with color #### Syntax ```csharp theme={"dark"} public static void WriteLine(string text, System.Nullable color = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | - | | `color` | `System.Nullable` | - | ### WriteLine Writes out a line with a specific color as a string #### Syntax ```csharp theme={"dark"} public static void WriteLine(string text, string color) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | Text to write | | `color` | `string` | A console color. Must match ConsoleColors collection names (case insensitive) | ### WriteSuccess Write a Success Line - green #### Syntax ```csharp theme={"dark"} public static void WriteSuccess(string text) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | Text to write out | ### WriteWarning Write a Warning Line - Yellow #### Syntax ```csharp theme={"dark"} public static void WriteWarning(string text) ``` #### Parameters | Name | Type | Description | | - | - | - | | `text` | `string` | Text to Write out | ### WriteWrappedHeader ## Writes a line of header text wrapped in a in a pair of lines of dashes: ## Header Text and allows you to specify a color for the header. The dashes are colored #### Syntax ```csharp theme={"dark"} public static void WriteWrappedHeader(string headerText, char wrapperChar = '-', System.ConsoleColor headerColor = 14, System.ConsoleColor dashColor = 8) ``` #### Parameters | Name | Type | Description | | - | - | - | | `headerText` | `string` | Header text to display | | `wrapperChar` | `char` | wrapper character (-) | | `headerColor` | `System.ConsoleColor` | Color for header text (yellow) | | `dashColor` | `System.ConsoleColor` | Color for dashes (gray) | # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/Tools/index Summary of the CloudNimble.Breakdance.Tools Namespace ## Types ### Classes | Name | Summary | | - | - | | [ColorConsole](/breakdance/api-reference/CloudNimble/Breakdance/Tools/ColorConsole) | Console Color Helper class that provides coloring to individual commands | # HttpClientHelpers Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/WebApi/HttpClientHelpers ## Definition **Assembly:** CloudNimble.Breakdance.WebApi.dll **Namespace:** CloudNimble.Breakdance.WebApi **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.WebApi.HttpClientHelpers ``` ## Methods ### GetTestableHttpRequestMessage Gets an [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) instance properly configured to be used to make test requests. #### Syntax ```csharp theme={"dark"} public static System.Net.Http.HttpRequestMessage GetTestableHttpRequestMessage(System.Net.Http.HttpMethod httpMethod, string host = "http://localhost/", string routePrefix = "api/tests/", string resource = "", string acceptHeader = "application/json", object payload = null, Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpMethod` | `System.Net.Http.HttpMethod` | The [HttpMethod](https://learn.microsoft.com/dotnet/api/system.net.http.httpmethod) to use for the request. | | `host` | `string` | The hostname to use for this request. Defaults to "[http://localhost](http://localhost)", only change it if that collides with other services running on the local machine. | | `routePrefix` | `string` | The routePrefix corresponding to the route already mapped in MapRestierRoute or GetTestableConfiguration. Defaults to "api/test", only change it if absolutely necessary. | | `resource` | `string` | The resource on the API to be requested. Defaults to an empty string. | | `acceptHeader` | `string` | The inbound MIME types to accept. Defaults to "application/json". | | `payload` | `object` | - | | `jsonSerializerSettings` | `Newtonsoft.Json.JsonSerializerSettings` | - | #### Returns Type: `System.Net.Http.HttpRequestMessage` An [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) that is ready to be sent through an HttpClient instance configured for the test. # WebApiConstants Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/WebApi/WebApiConstants A set of constants used by BreakDance.WebApi to simplify the configuration of test runs. ## Definition **Assembly:** CloudNimble.Breakdance.WebApi.dll **Namespace:** CloudNimble.Breakdance.WebApi **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.WebApi.WebApiConstants ``` ## Summary A set of constants used by BreakDance.WebApi to simplify the configuration of test runs. ## Remarks Since unit testing a WebApi should not require knowledge of a *specific* endpoint Url to execute (that's required in *integration* testing), these constants allow the test to run in a way that abstracts the details of configuring the API away from the developer. That allows the developer to focus on what is being tested, not on messing with configuration. # WebApiTestHelpers Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/WebApi/WebApiTestHelpers A set of methods that make it easier to pull out WebApi runtime components for unit testing. ## Definition **Assembly:** CloudNimble.Breakdance.WebApi.dll **Namespace:** CloudNimble.Breakdance.WebApi **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.Breakdance.WebApi.WebApiTestHelpers ``` ## Summary A set of methods that make it easier to pull out WebApi runtime components for unit testing. ## Remarks See WebApiTestHelperTests.cs for more examples of how to use these methods. ## Methods ### GetTestableConfiguration Gets a new [HttpConfiguration](/breakdance/api-reference/System/Web/Http/HttpConfiguration) using the default AttributeRouting mapping engine, suitable for use in unit tests. #### Syntax ```csharp theme={"dark"} public static System.Web.Http.HttpConfiguration GetTestableConfiguration() ``` #### Returns Type: `System.Web.Http.HttpConfiguration` A new [HttpConfiguration](/breakdance/api-reference/System/Web/Http/HttpConfiguration) instance. ### GetTestableHttpClient Gets a new [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) instance using the default AttributeRouting mapping engine, suitable for use in unit tests #### Syntax ```csharp theme={"dark"} public static System.Net.Http.HttpClient GetTestableHttpClient() ``` #### Returns Type: `System.Net.Http.HttpClient` a new [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) instance. ### GetTestableHttpServer Gets a new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) using the default AttributeRouting mapping engine, suitable for use in unit tests. #### Syntax ```csharp theme={"dark"} public static System.Web.Http.HttpServer GetTestableHttpServer() ``` #### Returns Type: `System.Web.Http.HttpServer` A new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) instance. # Overview Source: https://easyaf.dev/breakdance/api-reference/CloudNimble/Breakdance/WebApi/index Summary of the CloudNimble.Breakdance.WebApi Namespace ## Types ### Classes | Name | Summary | | - | - | | [HttpClientHelpers](/breakdance/api-reference/CloudNimble/Breakdance/WebApi/HttpClientHelpers) | | | [WebApiConstants](/breakdance/api-reference/CloudNimble/Breakdance/WebApi/WebApiConstants) | A set of constants used by BreakDance.WebApi to simplify the configuration of test runs. | | [WebApiTestHelpers](/breakdance/api-reference/CloudNimble/Breakdance/WebApi/WebApiTestHelpers) | A set of methods that make it easier to pull out WebApi runtime components for unit testing. | # ServiceCollection Source: https://easyaf.dev/breakdance/api-reference/Microsoft/Extensions/DependencyInjection/ServiceCollection Extension methods for ServiceCollection from Microsoft.Extensions.DependencyInjection.Abstractions ## Definition **Assembly:** Microsoft.Extensions.DependencyInjection.Abstractions.dll **Namespace:** Microsoft.Extensions.DependencyInjection ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.DependencyInjection.ServiceCollection ``` ## Summary This type is defined in Microsoft.Extensions.DependencyInjection.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicecollection) for more information about the rest of the API. ## Methods ### GetContainerContentsLog Extension Extension method from `Microsoft.Extensions.DependencyInjection.Breakdance_Assemblies_ServiceCollectionExtensions` #### Syntax ```csharp theme={"dark"} public static string GetContainerContentsLog(Microsoft.Extensions.DependencyInjection.ServiceCollection collection) ``` #### Parameters | Name | Type | Description | | - | - | - | | `collection` | `Microsoft.Extensions.DependencyInjection.ServiceCollection` | - | #### Returns Type: `string` # Overview Source: https://easyaf.dev/breakdance/api-reference/Microsoft/Extensions/DependencyInjection/index Summary of the Microsoft.Extensions.DependencyInjection Namespace ## Types # IHostBuilder Source: https://easyaf.dev/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder Extension methods for IHostBuilder from Microsoft.Extensions.Hosting.Abstractions ## Definition **Assembly:** Microsoft.Extensions.Hosting.Abstractions.dll **Namespace:** Microsoft.Extensions.Hosting ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.Hosting.IHostBuilder ``` ## Summary This type is defined in Microsoft.Extensions.Hosting.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostbuilder) for more information about the rest of the API. ## Methods ### Configure Extension Extension method from `Microsoft.Extensions.Hosting.BreakdanceHostBuilderExtensions` Configures the application request pipeline for the web host. This is a convenience wrapper around ConfigureWebHost for Breakdance test scenarios. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder Configure(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action configure) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) to configure. | | `configure` | `System.Action` | The delegate to configure the [IApplicationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder). | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) for chaining. ### GetAllServiceDescriptors Extension Extension method from `Microsoft.Extensions.DependencyInjection.Breakdance_Assemblies_IHostBuilderExtensions` Get all registered [ServiceDescriptor](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor)ServiceDescriptors\ for a given container. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.Dictionary GetAllServiceDescriptors(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | - | #### Returns Type: `System.Collections.Generic.Dictionary` #### Remarks Taken from [https://stackoverflow.com/a/60529530/403765](https://stackoverflow.com/a/60529530/403765) ### GetContainerContentsLog Extension Extension method from `Microsoft.Extensions.DependencyInjection.Breakdance_Assemblies_IHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static string GetContainerContentsLog(Microsoft.Extensions.Hosting.IHostBuilder hostBuilder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `hostBuilder` | `Microsoft.Extensions.Hosting.IHostBuilder` | - | #### Returns Type: `string` ### UseStartup Extension Extension method from `Microsoft.Extensions.Hosting.BreakdanceHostBuilderExtensions` Specifies the startup type to be used by the web host. This is a convenience wrapper around ConfigureWebHost for Breakdance test scenarios. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseStartup(Microsoft.Extensions.Hosting.IHostBuilder builder) where TStartup : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) to configure. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) for chaining. #### Type Parameters * `TStartup` - The startup type. # Overview Source: https://easyaf.dev/breakdance/api-reference/Microsoft/Extensions/Hosting/index Summary of the Microsoft.Extensions.Hosting Namespace ## Types # TestContext Source: https://easyaf.dev/breakdance/api-reference/Microsoft/VisualStudio/TestTools/UnitTesting/TestContext Extension methods for TestContext from MSTest.TestFramework.Extensions ## Definition **Assembly:** MSTest.TestFramework.Extensions.dll **Namespace:** Microsoft.VisualStudio.TestTools.UnitTesting ## Syntax ```csharp theme={"dark"} Microsoft.VisualStudio.TestTools.UnitTesting.TestContext ``` ## Summary This type is defined in MSTest.TestFramework.Extensions. ## Methods ### LogAndReturnMessageContentAsync Extension Extension method from `Microsoft.VisualStudio.TestTools.UnitTesting.Breakdance_MsTest2_TestContextExtensions` Attempts to unwrap the [Content](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage.content) and log it to the *testContext* if possible. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task LogAndReturnMessageContentAsync(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext, System.Net.Http.HttpResponseMessage message, bool nullIsExpected = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `testContext` | `Microsoft.VisualStudio.TestTools.UnitTesting.TestContext` | - | | `message` | `System.Net.Http.HttpResponseMessage` | - | | `nullIsExpected` | `bool` | Specifies whether the [Content](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage.content) in *message* is expected to be null. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This exists in order to safely allow the tests to continue in the absence of correct content. This is because the tests should log the response content BEFORE failing the test for an incorrect [StatusCode](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage.statuscode). # Overview Source: https://easyaf.dev/breakdance/api-reference/Microsoft/VisualStudio/TestTools/UnitTesting/index Summary of the Microsoft.VisualStudio.TestTools.UnitTesting Namespace ## Types # MimeTypeMap Source: https://easyaf.dev/breakdance/api-reference/MimeTypes/MimeTypeMap Class MimeTypeMap. ## Definition **Assembly:** CloudNimble.Breakdance.Assemblies.dll **Namespace:** MimeTypes **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} MimeTypes.MimeTypeMap ``` ## Summary Class MimeTypeMap. ## Methods ### GetExtension Gets the extension from the provided MINE type. #### Syntax ```csharp theme={"dark"} public static string GetExtension(string mimeType, bool throwErrorIfNotFound = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `mimeType` | `string` | Type of the MIME. | | `throwErrorIfNotFound` | `bool` | if set to `true`, throws error if extension's not found. | #### Returns Type: `string` The extension. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | | | `ArgumentException` | | ### GetMimeType Gets the type of the MIME from the provided string. #### Syntax ```csharp theme={"dark"} public static string GetMimeType(string str) ``` #### Parameters | Name | Type | Description | | - | - | - | | `str` | `string` | The filename or extension. | #### Returns Type: `string` The MIME type. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | | ### TryGetMimeType Tries to get the type of the MIME from the provided string. #### Syntax ```csharp theme={"dark"} public static bool TryGetMimeType(string str, out string mimeType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `str` | `string` | The filename or extension. | | `mimeType` | `string` | The variable to store the MIME type. | #### Returns Type: `bool` The MIME type. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | | # Overview Source: https://easyaf.dev/breakdance/api-reference/MimeTypes/index Summary of the MimeTypes Namespace ## Types ### Classes | Name | Summary | | - | - | | [MimeTypeMap](/breakdance/api-reference/MimeTypes/MimeTypeMap) | Class MimeTypeMap. | # IServiceProvider Source: https://easyaf.dev/breakdance/api-reference/System/IServiceProvider Extension methods for IServiceProvider from System.ComponentModel ## Definition **Assembly:** System.ComponentModel.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.IServiceProvider ``` ## Summary This type is defined in System.ComponentModel. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) for more information about the rest of the API. ## Methods ### GetAllServiceDescriptors Extension Extension method from `Microsoft.Extensions.DependencyInjection.Breakdance_Assemblies_IServiceProviderExtensions` Get all registered [ServiceDescriptor](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor)ServiceDescriptors\ for a given container. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.Dictionary GetAllServiceDescriptors(System.IServiceProvider provider) ``` #### Parameters | Name | Type | Description | | - | - | - | | `provider` | `System.IServiceProvider` | - | #### Returns Type: `System.Collections.Generic.Dictionary` #### Remarks Taken from [https://stackoverflow.com/a/60529530/403765](https://stackoverflow.com/a/60529530/403765) ### GetContainerContentsLog Extension Extension method from `Microsoft.Extensions.DependencyInjection.Breakdance_Assemblies_IServiceProviderExtensions` #### Syntax ```csharp theme={"dark"} public static string GetContainerContentsLog(System.IServiceProvider provider) ``` #### Parameters | Name | Type | Description | | - | - | - | | `provider` | `System.IServiceProvider` | - | #### Returns Type: `string` # HttpClient Source: https://easyaf.dev/breakdance/api-reference/System/Net/Http/HttpClient Extension methods for HttpClient from System.Net.Http ## Definition **Assembly:** System.Net.Http.dll **Namespace:** System.Net.Http ## Syntax ```csharp theme={"dark"} System.Net.Http.HttpClient ``` ## Summary This type is defined in System.Net.Http. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient) for more information about the rest of the API. ## Methods ### ExecuteTestRequest Extension Extension method from `System.Net.Http.Breakdance_WebApi_HttpClientExtensions` Creates an [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) for the given configuration and executes it asynchronously through the HttpClient. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task ExecuteTestRequest(System.Net.Http.HttpClient httpClient, System.Net.Http.HttpMethod httpMethod, string host = "http://localhost/", string routePrefix = "api/tests/", string resource = null, string acceptHeader = "application/json", object payload = null, Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpClient` | `System.Net.Http.HttpClient` | The [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) instance to use. | | `httpMethod` | `System.Net.Http.HttpMethod` | The [HttpMethod](https://learn.microsoft.com/dotnet/api/system.net.http.httpmethod) to use for the request. | | `host` | `string` | The hostname to use for this request. Defaults to "[http://localhost](http://localhost)", only change it if that collides with other services running on the local machine. | | `routePrefix` | `string` | The routePrefix corresponding to the route already mapped in MapRestierRoute or GetTestableConfiguration. Defaults to "api/test", only change it if absolutely necessary. | | `resource` | `string` | The resource on the API to be requested. | | `acceptHeader` | `string` | The inbound MIME types to accept. Defaults to "application/json". | | `payload` | `object` | - | | `jsonSerializerSettings` | `Newtonsoft.Json.JsonSerializerSettings` | - | #### Returns Type: `System.Threading.Tasks.Task` An [HttpResponseMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage) containing the results of the attempted request. #### Examples This sample shows the simplest way to create a testable [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) and execute a test request, using MSTest and FluentAssertions. ```csharp theme={"dark"} [TestClass] ApiTests { hod] sync Task TestApi_Companies_ReturnsResults() { httpClient = WebApiTestHelpers.GetTestableHttpClient(); result = await httpClient.ExecuteTestRequest(HttpMethods.Get, resource = "/Companies"); lt.Should().NotBeNull(); lt.StatusCode.Should().Be(HttpStatusCode.OK); content = await result.Content.ReadAsStringAsync(); ent.Should().NotBeNullOrWhiteSpace(); } } ``` # Overview Source: https://easyaf.dev/breakdance/api-reference/System/Net/Http/index Summary of the System.Net.Http Namespace ## Types # Object Source: https://easyaf.dev/breakdance/api-reference/System/Object Extension methods for Object from System.Private.CoreLib ## Definition **Assembly:** System.Private.CoreLib.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} object ``` ## Summary This type is defined in System.Private.CoreLib. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.object) for more information about the rest of the API. ## Methods ### GetFieldValue Extension Extension method from `System.Breakdance_Assemblies_ObjectExtensions` #### Syntax ```csharp theme={"dark"} public static object GetFieldValue(object obj, string fieldName, bool throwIfNull = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | - | | `fieldName` | `string` | - | | `throwIfNull` | `bool` | - | #### Returns Type: `object` ### GetPropertyValue Extension Extension method from `System.Breakdance_Assemblies_ObjectExtensions` #### Syntax ```csharp theme={"dark"} public static object GetPropertyValue(object obj, string propertyName, bool throwIfNull = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | - | | `propertyName` | `string` | - | | `throwIfNull` | `bool` | - | #### Returns Type: `object` ### SetFieldValue Extension Extension method from `System.Breakdance_Assemblies_ObjectExtensions` #### Syntax ```csharp theme={"dark"} public static void SetFieldValue(object obj, string fieldName, object val) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | - | | `fieldName` | `string` | - | | `val` | `object` | - | ### SetPropertyValue Extension Extension method from `System.Breakdance_Assemblies_ObjectExtensions` #### Syntax ```csharp theme={"dark"} public static void SetPropertyValue(object obj, string propertyName, object val) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object` | - | | `propertyName` | `string` | - | | `val` | `object` | - | # ConstructorInfo Source: https://easyaf.dev/breakdance/api-reference/System/Reflection/ConstructorInfo Extension methods for ConstructorInfo from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System.Reflection ## Syntax ```csharp theme={"dark"} System.Reflection.ConstructorInfo ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.reflection.constructorinfo) for more information about the rest of the API. ## Methods ### IsProtected Extension Extension method from `System.Reflection.Breakdance_Assemblies_MethodBaseExtensions` #### Syntax ```csharp theme={"dark"} public static bool IsProtected(System.Reflection.ConstructorInfo info, System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `info` | `System.Reflection.ConstructorInfo` | - | | `type` | `System.Type` | - | #### Returns Type: `bool` # FieldInfo Source: https://easyaf.dev/breakdance/api-reference/System/Reflection/FieldInfo Extension methods for FieldInfo from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System.Reflection ## Syntax ```csharp theme={"dark"} System.Reflection.FieldInfo ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.reflection.fieldinfo) for more information about the rest of the API. ## Methods ### IsProtected Extension Extension method from `System.Reflection.Breakdance_Assemblies_MethodBaseExtensions` #### Syntax ```csharp theme={"dark"} public static bool IsProtected(System.Reflection.FieldInfo info, System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `info` | `System.Reflection.FieldInfo` | - | | `type` | `System.Type` | - | #### Returns Type: `bool` # MethodInfo Source: https://easyaf.dev/breakdance/api-reference/System/Reflection/MethodInfo Extension methods for MethodInfo from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System.Reflection ## Syntax ```csharp theme={"dark"} System.Reflection.MethodInfo ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.reflection.methodinfo) for more information about the rest of the API. ## Methods ### IsProtected Extension Extension method from `System.Reflection.Breakdance_Assemblies_MethodBaseExtensions` #### Syntax ```csharp theme={"dark"} public static bool IsProtected(System.Reflection.MethodInfo info, System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `info` | `System.Reflection.MethodInfo` | - | | `type` | `System.Type` | - | #### Returns Type: `bool` # Overview Source: https://easyaf.dev/breakdance/api-reference/System/Reflection/index Summary of the System.Reflection Namespace ## Types # HttpConfiguration Source: https://easyaf.dev/breakdance/api-reference/System/Web/Http/HttpConfiguration Extension methods for HttpConfiguration from System.Web.Http ## Definition **Assembly:** System.Web.Http.dll **Namespace:** System.Web.Http ## Syntax ```csharp theme={"dark"} System.Web.Http.HttpConfiguration ``` ## Summary This type is defined in System.Web.Http. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.web.http.httpconfiguration) for more information about the rest of the API. ## Methods ### GetTestableHttpClient Extension Extension method from `System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions` Creates a new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) for a given [HttpConfiguration](/breakdance/api-reference/System/Web/Http/HttpConfiguration), and returns a new [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) that uses said [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver). #### Syntax ```csharp theme={"dark"} public static System.Net.Http.HttpClient GetTestableHttpClient(System.Web.Http.HttpConfiguration config) ``` #### Parameters | Name | Type | Description | | - | - | - | | `config` | `System.Web.Http.HttpConfiguration` | The [HttpConfiguration](/breakdance/api-reference/System/Web/Http/HttpConfiguration) to use with the internal [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver). | #### Returns Type: `System.Net.Http.HttpClient` An [HttpClient](/breakdance/api-reference/System/Net/Http/HttpClient) whose configuration is bonded to an [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) so developers don't have to manually configure all of the elements required to successfully test the API. ### GetTestableHttpServer Extension Extension method from `System.Web.Http.Breakdance_WebApi_HttpConfigurationExtensions` Gets a new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) instance for a given [HttpConfiguration](/breakdance/api-reference/System/Web/Http/HttpConfiguration), suitable for use in unit tests. #### Syntax ```csharp theme={"dark"} public static System.Web.Http.HttpServer GetTestableHttpServer(System.Web.Http.HttpConfiguration config) ``` #### Parameters | Name | Type | Description | | - | - | - | | `config` | `System.Web.Http.HttpConfiguration` | - | #### Returns Type: `System.Web.Http.HttpServer` A new [HttpServer](https://learn.microsoft.com/dotnet/api/system.web.http.httpserver) instance whose InnerHandler allows for automatic HTTP redirects. # Overview Source: https://easyaf.dev/breakdance/api-reference/System/Web/Http/index Summary of the System.Web.Http Namespace ## Types # Overview Source: https://easyaf.dev/breakdance/api-reference/System/index Summary of the System Namespace ## Types ### Classes | Name | Summary | | - | - | | [Object](/breakdance/api-reference/System/Object) | This type is defined in System.Private.CoreLib. | # Guides Source: https://easyaf.dev/breakdance/guides/index Step-by-step tutorials for testing real things in your .NET applications with Breakdance. Breakdance provides specialized testing support for various .NET technologies. These guides walk you through practical scenarios using the "Test Real Things" philosophy - no mocks, no fakes, just real behavior. ## By Category Test HTTP APIs with in-memory servers and HTTP snapshots Integration testing with Azurite for Blob, Queue, and Table storage ## Web & API Testing Learn the "Test Real Things" philosophy and how snapshots replace mocking Capture real HTTP responses and replay them for fast, deterministic tests Write API tests using Visual Studio's `.http` file format with variables and chaining Test ASP.NET Core APIs with in-memory TestServer Test ASP.NET Web API 2 controllers on .NET Framework ## Azure Services Test against real Blob, Queue, and Table storage using the Azurite emulator ## Getting Started New to Breakdance? Start with understanding [Why Breakdance?](/breakdance/why-breakdance) to learn the philosophy, then explore the guides relevant to your application's technology stack. Each guide includes practical examples you can copy directly into your test projects. All examples follow the "Test Real Things" approach - capturing real behavior instead of mocking it. # Testing with Azure Storage (Azurite) Source: https://easyaf.dev/breakdance/guides/testing-azure-storage Learn how to write integration tests against Azure Blob, Queue, and Table Storage using the Azurite emulator with Breakdance. Breakdance provides first-class support for testing Azure Storage services using [Azurite](https://github.com/Azure/Azurite), Microsoft's official Azure Storage emulator. The `CloudNimble.Breakdance.Azurite` package handles all the complexity of starting, configuring, and stopping Azurite instances during your test runs. ## Prerequisites Before you begin, ensure you have: Azurite runs on Node.js. Install it from [nodejs.org](https://nodejs.org/) or via your package manager. Install Azurite globally using npm: ```bash theme={"dark"} npm install -g azurite ``` Add the Breakdance Azurite package to your test project: ```bash theme={"dark"} dotnet add package CloudNimble.Breakdance.Azurite ``` ## Quick Start The simplest way to get started is to create a test class that inherits from `AzuriteTestBase`: ```csharp MyStorageTests.cs theme={"dark"} using CloudNimble.Breakdance.Azurite; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading.Tasks; [TestClass] public class MyStorageTests : AzuriteTestBase { private static AzuriteInstance _azurite; protected override AzuriteInstance Azurite => _azurite; [ClassInitialize] public static async Task ClassInit(TestContext ctx) { _azurite = await CreateAndStartInstanceAsync(new AzuriteConfiguration { Services = AzuriteServiceType.All, InMemoryPersistence = true, Silent = true }); } [ClassCleanup] public static async Task ClassCleanup() { await StopAndDisposeAsync(_azurite); _azurite = null; } [TestMethod] public async Task CanUploadBlob() { // Use the ConnectionString property to connect to Azurite var blobServiceClient = new BlobServiceClient(ConnectionString); var container = blobServiceClient.GetBlobContainerClient("test-container"); await container.CreateIfNotExistsAsync(); var blob = container.GetBlobClient("test-blob.txt"); await blob.UploadAsync(BinaryData.FromString("Hello, Azurite!")); Assert.IsTrue(await blob.ExistsAsync()); } } ``` Each test class owns its own static `AzuriteInstance` field. This design avoids cross-class pollution where multiple test classes would share the same instance, which can cause port conflicts and test interference. ## Configuration Options The `AzuriteConfiguration` class provides extensive options for customizing your Azurite instance: ### Selecting Services You can start only the services you need to reduce resource usage and startup time: ```csharp theme={"dark"} var config = new AzuriteConfiguration { Services = AzuriteServiceType.All // Blob, Queue, and Table }; ``` ```csharp theme={"dark"} var config = new AzuriteConfiguration { Services = AzuriteServiceType.Blob }; ``` ```csharp theme={"dark"} var config = new AzuriteConfiguration { Services = AzuriteServiceType.Queue }; ``` ```csharp theme={"dark"} var config = new AzuriteConfiguration { Services = AzuriteServiceType.Blob | AzuriteServiceType.Queue }; ``` Table-only mode (`AzuriteServiceType.Table` alone) is currently not supported due to an upstream bug in Azurite where the table service reports incorrect port information. Use `AzuriteServiceType.All` if you need Table storage. ### Storage Persistence By default, Azurite runs with in-memory persistence, which is fast and automatically cleans up after tests: ```csharp theme={"dark"} var config = new AzuriteConfiguration { InMemoryPersistence = true, // Default: true ExtentMemoryLimitMB = 512 // Optional: limit memory usage }; ``` For tests that need to persist data to disk: ```csharp theme={"dark"} var config = new AzuriteConfiguration { InMemoryPersistence = false, Location = @"C:\temp\azurite-data" // Directory for data files }; ``` ### Port Configuration Breakdance automatically assigns random ports (20000-30000) to avoid conflicts when running tests in parallel: ```csharp theme={"dark"} var config = new AzuriteConfiguration { AutoAssignPorts = true, // Default: true MaxRetries = 20 // Retry attempts if port is in use }; ``` If you need specific ports (not recommended for CI/CD): ```csharp theme={"dark"} var config = new AzuriteConfiguration { AutoAssignPorts = false, BlobPort = 10000, QueuePort = 10001, TablePort = 10002 }; ``` ### All Configuration Options | Property | Type | Default | Description | | - | - | - | - | | `Services` | `AzuriteServiceType` | `All` | Which services to start (Blob, Queue, Table, or combinations) | | `InMemoryPersistence` | `bool` | `true` | Use in-memory storage instead of disk | | `Silent` | `bool` | `true` | Suppress Azurite access logs | | `ExtentMemoryLimitMB` | `int?` | `null` | Memory limit for in-memory mode | | `SkipApiVersionCheck` | `bool` | `true` | Skip API version validation | | `DisableTelemetry` | `bool` | `true` | Disable Azurite telemetry | | `LooseMode` | `bool` | `false` | Ignore unsupported headers/parameters | | `AutoAssignPorts` | `bool` | `true` | Automatically assign random ports | | `MaxRetries` | `int` | `20` | Port conflict retry attempts | | `StartupTimeoutSeconds` | `int` | `30` | Timeout waiting for Azurite to start | | `BlobPort` | `int?` | `null` | Specific blob service port | | `QueuePort` | `int?` | `null` | Specific queue service port | | `TablePort` | `int?` | `null` | Specific table service port | | `Location` | `string` | `null` | Disk persistence directory | | `DebugLogPath` | `string` | `null` | Path for debug log file | ## Accessing Azurite Once your test class is set up, `AzuriteTestBase` provides convenient properties for connecting to the services: ```csharp theme={"dark"} [TestMethod] public void AccessEndpoints() { // Connection string for Azure SDK clients var connectionString = ConnectionString; // Individual endpoint URLs var blobUrl = BlobEndpoint; // e.g., "http://127.0.0.1:23456" var queueUrl = QueueEndpoint; // e.g., "http://127.0.0.1:23457" var tableUrl = TableEndpoint; // e.g., "http://127.0.0.1:23458" // Port numbers (useful for custom configurations) var blobPort = BlobPort; // e.g., 23456 var queuePort = QueuePort; // e.g., 23457 var tablePort = TablePort; // e.g., 23458 } ``` Endpoint properties return `null` if that service was not requested in the configuration. For example, if you set `Services = AzuriteServiceType.Blob`, then `QueueEndpoint` and `TableEndpoint` will be `null`. ## Testing Patterns ### Testing Blob Storage ```csharp theme={"dark"} [TestMethod] public async Task BlobStorage_CanUploadAndDownload() { // Arrange var client = new BlobServiceClient(ConnectionString); var container = client.GetBlobContainerClient("test-container"); await container.CreateIfNotExistsAsync(); var blobName = $"test-{Guid.NewGuid()}.txt"; var blob = container.GetBlobClient(blobName); var content = "Hello, World!"; // Act await blob.UploadAsync(BinaryData.FromString(content)); var downloaded = await blob.DownloadContentAsync(); // Assert Assert.AreEqual(content, downloaded.Value.Content.ToString()); } ``` ### Testing Queue Storage ```csharp theme={"dark"} [TestMethod] public async Task QueueStorage_CanSendAndReceiveMessages() { // Arrange var client = new QueueServiceClient(ConnectionString); var queue = client.GetQueueClient("test-queue"); await queue.CreateIfNotExistsAsync(); // Act await queue.SendMessageAsync("Test message"); var messages = await queue.ReceiveMessagesAsync(maxMessages: 1); // Assert Assert.AreEqual(1, messages.Value.Length); Assert.AreEqual("Test message", messages.Value[0].MessageText); } ``` ### Testing Table Storage ```csharp theme={"dark"} [TestMethod] public async Task TableStorage_CanAddAndQueryEntities() { // Arrange var client = new TableServiceClient(ConnectionString); var table = client.GetTableClient("testtable"); await table.CreateIfNotExistsAsync(); var entity = new TableEntity("partition1", "row1") { { "Name", "Test Entity" }, { "Value", 42 } }; // Act await table.AddEntityAsync(entity); var result = await table.GetEntityAsync("partition1", "row1"); // Assert Assert.AreEqual("Test Entity", result.Value["Name"]); Assert.AreEqual(42, result.Value["Value"]); } ``` ## Advanced Scenarios ### Sharing an Instance Across Multiple Test Classes If you have many test classes that need the same Azurite configuration, you can use assembly-level initialization: ```csharp AssemblySetup.cs theme={"dark"} using CloudNimble.Breakdance.Azurite; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading.Tasks; [TestClass] public static class AssemblySetup { public static AzuriteInstance SharedAzurite { get; private set; } [AssemblyInitialize] public static async Task AssemblyInit(TestContext ctx) { SharedAzurite = new AzuriteInstance(new AzuriteConfiguration { Services = AzuriteServiceType.All, InMemoryPersistence = true, Silent = true }); await SharedAzurite.StartAsync(); } [AssemblyCleanup] public static async Task AssemblyCleanup() { if (SharedAzurite != null) { await SharedAzurite.DisposeAsync(); SharedAzurite = null; } } } ``` Then reference it in your test classes: ```csharp theme={"dark"} [TestClass] public class MyTests : AzuriteTestBase { protected override AzuriteInstance Azurite => AssemblySetup.SharedAzurite; [TestMethod] public void MyTest() { Assert.IsNotNull(BlobEndpoint); } } ``` When sharing an Azurite instance across test classes, be careful about test isolation. Tests that create containers or queues may interfere with each other. Consider using unique names (e.g., with `Guid.NewGuid()`) for test resources. ### Using with Dependency Injection If your application uses dependency injection, you can register Azure Storage clients with the Azurite connection string: ```csharp theme={"dark"} [TestMethod] public async Task TestWithDependencyInjection() { // Arrange var services = new ServiceCollection(); services.AddSingleton(_ => new BlobServiceClient(ConnectionString)); services.AddSingleton(_ => new QueueServiceClient(ConnectionString)); services.AddSingleton(_ => new TableServiceClient(ConnectionString)); // Add your application services services.AddTransient(); var provider = services.BuildServiceProvider(); var myService = provider.GetRequiredService(); // Act & Assert await myService.DoSomethingWithStorageAsync(); } ``` ## Troubleshooting Ensure Node.js and Azurite are installed: ```bash theme={"dark"} node --version npx azurite --version ``` If Azurite is not found, install it globally: `npm install -g azurite` By default, Breakdance uses random ports and retries on conflicts. If you're seeing persistent port issues, check for orphaned Azurite processes: ```bash theme={"dark"} # Windows taskkill /F /IM node.exe # macOS/Linux pkill -f azurite ``` Each test class should have its own static `AzuriteInstance` field. If you're sharing an instance, use unique resource names in each test to avoid conflicts. * Use `InMemoryPersistence = true` for faster startup * Only start the services you need (e.g., `AzuriteServiceType.Blob` instead of `All`) * Consider sharing an instance across test classes if appropriate ## Related Resources Official Microsoft documentation for Azurite .NET SDK documentation for Azure Storage # ASP.NET Classic Web API Testing Source: https://easyaf.dev/breakdance/guides/web/aspnet-classic-rest Test ASP.NET WebAPI 2 controllers on .NET Framework with fast, in-memory HTTP testing. This guide covers testing **ASP.NET Web API 2** controllers that run on the **.NET Framework** (4.6.2+). If you're using **ASP.NET Core** (running on .NET 6+), see the [ASP.NET Core testing guide](/breakdance/guides/web/aspnet-core-rest) instead. Testing Web API controllers traditionally requires running a full HTTP server, which is slow and can have port conflicts. Breakdance provides helpers that create an in-memory HTTP pipeline, letting you test your controllers directly without network overhead. ## Prerequisites Add the Breakdance WebApi package to your test project: ```bash theme={"dark"} dotnet add package Breakdance.WebApi ``` Your test project needs a reference to the project containing your controllers: ```xml theme={"dark"} ``` ## Quick Start The simplest approach uses `WebApiTestHelpers` to get a fully configured HttpClient: ```csharp MyApiTests.cs theme={"dark"} using CloudNimble.Breakdance.WebApi; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Net; using System.Net.Http; using System.Threading.Tasks; [TestClass] public class MyApiTests { [TestMethod] public async Task GetUsers_ReturnsSuccessStatusCode() { // Get an HttpClient wired up to your API's in-memory pipeline var httpClient = WebApiTestHelpers.GetTestableHttpClient(); // Make requests just like you would against a real server var response = await httpClient.ExecuteTestRequest( HttpMethod.Get, resource: "/api/users"); // Assert Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); } } ``` The `ExecuteTestRequest` extension method handles building the request URL and headers for you. It defaults to `http://localhost/api/test` as the base path. ## How It Works When you call `GetTestableHttpClient()`, Breakdance creates: 1. An `HttpConfiguration` with attribute routing enabled 2. An `HttpServer` that processes requests in-memory 3. An `HttpClient` connected to that server ```csharp theme={"dark"} // These three lines are equivalent to calling WebApiTestHelpers.GetTestableHttpClient() var config = new HttpConfiguration(); config.MapHttpAttributeRoutes(); config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; var server = new HttpServer(config); var client = new HttpClient(server); ``` Your controllers are discovered automatically from referenced assemblies. ## Configuration Options ### Custom HttpConfiguration If your API requires specific configuration (like custom routes or services), use the extension methods on `HttpConfiguration`: ```csharp theme={"dark"} [TestMethod] public async Task CustomConfiguration_Works() { var config = new HttpConfiguration(); // Add your custom routes config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); // Register your DI container config.DependencyResolver = new MyDependencyResolver(); // Get a client using your custom config var client = config.GetTestableHttpClient(); var response = await client.ExecuteTestRequest( HttpMethod.Get, routePrefix: "api", // Match your route template resource: "/products"); Assert.IsTrue(response.IsSuccessStatusCode); } ``` ### Changing the Route Prefix The default route prefix is `api/test`. Override it to match your API's routes: ```csharp theme={"dark"} var response = await client.ExecuteTestRequest( HttpMethod.Get, routePrefix: "api/v1", resource: "/customers"); ``` ### Custom Host If `localhost` conflicts with something on your machine: ```csharp theme={"dark"} var response = await client.ExecuteTestRequest( HttpMethod.Get, host: "http://testhost", resource: "/api/orders"); ``` ## Sending Request Bodies For POST, PUT, and PATCH requests, pass a payload object: ```csharp theme={"dark"} [TestMethod] public async Task CreateUser_WithValidPayload_Returns201() { var client = WebApiTestHelpers.GetTestableHttpClient(); var newUser = new { Name = "John Doe", Email = "john@example.com" }; var response = await client.ExecuteTestRequest( HttpMethod.Post, resource: "/api/users", payload: newUser); Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); } ``` The payload is automatically serialized to JSON using Newtonsoft.Json. ## Reading Response Content ```csharp theme={"dark"} [TestMethod] public async Task GetUser_ReturnsUserData() { var client = WebApiTestHelpers.GetTestableHttpClient(); var response = await client.ExecuteTestRequest( HttpMethod.Get, resource: "/api/users/1"); // Read the response body var content = await response.Content.ReadAsStringAsync(); Assert.IsFalse(string.IsNullOrWhiteSpace(content)); // Or deserialize directly var user = JsonConvert.DeserializeObject(content); Assert.AreEqual(1, user.Id); } ``` ## Testing Error Responses In-memory testing surfaces the same error responses your API would return in production: ```csharp theme={"dark"} [TestMethod] public async Task GetUser_NotFound_Returns404() { var client = WebApiTestHelpers.GetTestableHttpClient(); var response = await client.ExecuteTestRequest( HttpMethod.Get, resource: "/api/users/99999"); Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode); } [TestMethod] public async Task CreateUser_InvalidData_Returns400() { var client = WebApiTestHelpers.GetTestableHttpClient(); var invalidUser = new { Name = "", Email = "not-an-email" }; var response = await client.ExecuteTestRequest( HttpMethod.Post, resource: "/api/users", payload: invalidUser); Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode); } ``` Because `IncludeErrorDetailPolicy.Always` is set, you'll get detailed error messages in the response body. This is helpful for debugging test failures but should not be enabled in production. ## Comparison: In-Memory vs Real Server Testing | Aspect | In-Memory Testing | Real Server Testing | | - | - | - | | Speed | Fast (no network) | Slower (HTTP overhead) | | Port conflicts | None | Possible | | Full HTTP stack | No (no network layer) | Yes | | SSL testing | No | Yes | | Message handlers | Full support | Full support | | Best for | Unit tests, CI/CD | Integration tests, E2E | ## Limitations The `Breakdance.WebApi` package is specifically for ASP.NET Web API 2 on .NET Framework. It does not support: * ASP.NET Core applications (use [Breakdance.AspNetCore](/breakdance/guides/web/aspnet-core-rest) instead) * OWIN/Katana middleware * SignalR ## Related Resources Test ASP.NET Core APIs with TestServer Capture and replay HTTP responses for deterministic tests # ASP.NET Core API Testing Source: https://easyaf.dev/breakdance/guides/web/aspnet-core-rest Test ASP.NET Core APIs with in-memory TestServer for fast, reliable unit and integration tests. This guide covers testing **ASP.NET Core** APIs running on **.NET 8** or later. If you're using **ASP.NET Web API 2** on .NET Framework, see the [ASP.NET Classic testing guide](/breakdance/guides/web/aspnet-classic-rest) instead. Breakdance provides a powerful test base class that wraps ASP.NET Core's `TestServer`, giving you in-memory HTTP testing with full dependency injection support. ## Prerequisites Add the Breakdance AspNetCore package to your test project: ```bash theme={"dark"} dotnet add package Breakdance.AspNetCore ``` Your test project needs a reference to the project containing your controllers: ```xml theme={"dark"} ``` ## Quick Start Inherit from `AspNetCoreBreakdanceTestBase` to get automatic TestServer management: ```csharp MyApiTests.cs theme={"dark"} using CloudNimble.Breakdance.AspNetCore; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Net; using System.Threading.Tasks; [TestClass] public class MyApiTests : AspNetCoreBreakdanceTestBase { [TestInitialize] public void Setup() { // Configure the API services AddApis(); TestSetup(); } [TestMethod] public async Task GetUsers_ReturnsSuccess() { var client = GetHttpClient(); var response = await client.GetAsync("/users"); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); } [TestCleanup] public void Cleanup() { TestTearDown(); } } ``` ## Configuration Methods `AspNetCoreBreakdanceTestBase` provides several helper methods to configure your test environment: ### AddApis() Configures the test server with controller support (authorization, CORS, data annotations, formatter mappings): ```csharp theme={"dark"} [TestInitialize] public void Setup() { AddApis(); TestSetup(); } ``` This is equivalent to calling `services.AddControllers()` in your `Startup.cs`. ### AddMinimalMvc() Registers only the minimum MVC services needed to route requests and invoke controllers: ```csharp theme={"dark"} [TestInitialize] public void Setup() { AddMinimalMvc(); TestSetup(); } ``` Use this for lightweight tests where you don't need the full controller feature set. ### AddViews() Configures support for controllers with Razor views: ```csharp theme={"dark"} [TestInitialize] public void Setup() { AddViews(); TestSetup(); } ``` ### AddRazorPages() Configures support for Razor Pages: ```csharp theme={"dark"} [TestInitialize] public void Setup() { AddRazorPages(); TestSetup(); } ``` ## Custom Configuration For more control, configure the `TestHostBuilder` directly: ```csharp theme={"dark"} [TestInitialize] public void Setup() { // Add custom services TestHostBuilder.ConfigureServices(services => { services.AddControllers(); services.AddScoped(); services.AddDbContext(options => options.UseInMemoryDatabase("TestDb")); }); // Configure the application pipeline TestHostBuilder.Configure(app => { app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => endpoints.MapControllers()); }); // Configure app settings TestHostBuilder.ConfigureAppConfiguration(config => { config.AddInMemoryCollection(new Dictionary { ["ConnectionStrings:Default"] = "InMemory", ["Features:EnableNewFeature"] = "true" }); }); TestSetup(); } ``` ## Getting an HttpClient Use `GetHttpClient()` to get a client connected to the in-memory test server: ```csharp theme={"dark"} [TestMethod] public async Task GetUsers_ReturnsUserList() { // Default base address is http://localhost/api/test var client = GetHttpClient(); var response = await client.GetAsync("/users"); var content = await response.Content.ReadAsStringAsync(); Assert.IsTrue(response.IsSuccessStatusCode); Assert.IsFalse(string.IsNullOrWhiteSpace(content)); } ``` ### Custom Route Prefix Override the default route prefix: ```csharp theme={"dark"} var client = GetHttpClient(routePrefix: "api/v2"); ``` ### With Authentication Add authentication headers: ```csharp theme={"dark"} using System.Net.Http.Headers; var authHeader = new AuthenticationHeaderValue("Bearer", "your-test-token"); var client = GetHttpClient(authHeader); var response = await client.GetAsync("/protected-resource"); ``` ## Accessing Services Resolve services from the test server's dependency injection container: ```csharp theme={"dark"} [TestMethod] public void CanResolveServices() { var userService = GetService(); Assert.IsNotNull(userService); } [TestMethod] public void CanResolveMultipleImplementations() { var handlers = GetServices(); Assert.IsTrue(handlers.Any()); } ``` For .NET 8+, keyed services are also supported: ```csharp theme={"dark"} [TestMethod] public void CanResolveKeyedServices() { var primaryCache = GetKeyedService("primary"); var secondaryCache = GetKeyedService("secondary"); Assert.IsNotNull(primaryCache); Assert.IsNotNull(secondaryCache); } ``` ## Testing POST/PUT/PATCH Requests ```csharp theme={"dark"} [TestMethod] public async Task CreateUser_ReturnsCreated() { var client = GetHttpClient(); var newUser = new { Name = "John Doe", Email = "john@example.com" }; var content = new StringContent( JsonSerializer.Serialize(newUser), Encoding.UTF8, "application/json"); var response = await client.PostAsync("/users", content); Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); } ``` ## Testing Error Responses ```csharp theme={"dark"} [TestMethod] public async Task GetUser_NotFound_Returns404() { var client = GetHttpClient(); var response = await client.GetAsync("/users/99999"); Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode); } [TestMethod] public async Task CreateUser_InvalidData_Returns400() { var client = GetHttpClient(); var invalidUser = new { Name = "", Email = "not-an-email" }; var content = new StringContent( JsonSerializer.Serialize(invalidUser), Encoding.UTF8, "application/json"); var response = await client.PostAsync("/users", content); Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode); } ``` ## Using Static Helpers For simpler scenarios, use `AspNetCoreTestHelpers` without inheriting from the test base: ```csharp theme={"dark"} using CloudNimble.Breakdance.AspNetCore; using Microsoft.AspNetCore.TestHost; [TestMethod] public async Task QuickTest() { var testServer = await AspNetCoreTestHelpers.GetTestableHttpServerAsync( registration: services => { services.AddControllers(); }, builder: app => { app.UseRouting(); app.UseEndpoints(endpoints => endpoints.MapControllers()); }); var client = testServer.CreateClient(); var response = await client.GetAsync("/api/health"); Assert.IsTrue(response.IsSuccessStatusCode); } ``` ## Integration with FluentAssertions Combine with FluentAssertions for more expressive tests: ```csharp theme={"dark"} using FluentAssertions; [TestMethod] public async Task GetUsers_ReturnsNonEmptyList() { var client = GetHttpClient(); var response = await client.GetAsync("/users"); var content = await response.Content.ReadAsStringAsync(); var users = JsonSerializer.Deserialize>(content); response.StatusCode.Should().Be(HttpStatusCode.OK); users.Should().NotBeEmpty(); users.Should().AllSatisfy(u => u.Email.Should().Contain("@")); } ``` ## Comparison: TestServer vs Real Server | Aspect | TestServer (In-Memory) | Real Server | | - | - | - | | Speed | Fast (no network) | Slower (HTTP overhead) | | Port conflicts | None | Possible | | Full HTTP stack | Most features | Yes | | SSL testing | Limited | Yes | | Middleware | Full support | Full support | | Authentication | Configurable | Full support | | Best for | Unit tests, CI/CD | E2E tests | ## Lifecycle Understanding the test lifecycle helps avoid common issues: ```csharp theme={"dark"} [TestClass] public class LifecycleExample : AspNetCoreBreakdanceTestBase { [AssemblyInitialize] public static void AssemblyInit(TestContext context) { // Runs once before all tests in the assembly } [TestInitialize] public void TestInit() { // Configure services and middleware AddApis(); // This builds and starts the TestServer TestSetup(); } [TestMethod] public async Task MyTest() { // TestServer is ready to use var client = GetHttpClient(); // ... } [TestCleanup] public void TestCleanup() { // Disposes the TestServer TestTearDown(); } } ``` ## Related Resources Test ASP.NET Web API 2 on .NET Framework Capture and replay HTTP responses for deterministic tests # Web & API Testing Source: https://easyaf.dev/breakdance/guides/web/index Test HTTP APIs and web services with in-memory servers, request snapshots, and response snapshots. Breakdance provides multiple approaches for testing web APIs, each suited to different scenarios. Choose based on your testing needs: ## Choose Your Approach **Best for:** Unit testing HTTP APIs you're building without deploying infra Fast, no network overhead, great for CI/CD **Best for:** Replicating requests from 3rd party APIs `.http` files with variables, request chaining **Best for:** Replicating responses from 3rd party APIs Capture once, replay everywhere ## Quick Comparison | Feature | In-Memory | Request Snapshots | Response Snapshots | | - | - | - | - | | Network calls | None | Optional | Captured | | Test speed | Fastest | Fast | Fast (cached) | | Real API testing | No | Yes | Initial capture | | Offline capable | Yes | With snapshots | Yes | | Request chaining | Manual | Built-in | N/A | | Environment configs | N/A | Yes | Per-folder | ## Combining Approaches These techniques work well together. See the [Snapshots Overview](/breakdance/guides/web/snapshots/index) for the full philosophy. ```csharp theme={"dark"} // Use .http file format with captured response snapshots public class ApiTests : DotHttpTestBase { protected override HttpMessageHandler CreateHttpMessageHandler() { // Serve responses from snapshot files return new ResponseSnapshotReplayHandler("ResponseSnapshots"); } [TestMethod] public async Task GetUsers_Test() { SetVariable("baseUrl", "https://api.example.com"); var response = await SendRequestAsync(new DotHttpRequest { Method = "GET", Url = "{{baseUrl}}/users" }); await DotHttpAssertions.AssertValidResponseAsync(response); } } ``` ## Guides Test ASP.NET Core APIs with the built-in TestServer. Fast, in-memory testing with full dependency injection support. Test ASP.NET Web API 2 controllers on .NET Framework without a real HTTP server. Create an HttpClient wired directly to your API's routing pipeline. Learn about Breakdance's "Test Real Things" philosophy and how snapshots replace traditional mocking for API tests. Write API tests using Visual Studio's `.http` file format. Supports variables, environment files, and request chaining with response extraction. Capture HTTP responses from real APIs and replay them in tests. Perfect for testing against external services without network dependencies. ## Related Packages | Package | Purpose | | - | - | | `Breakdance.WebApi` | In-memory Web API 2 testing on .NET Framework | | `Breakdance.AspNetCore` | In-memory ASP.NET Core testing with TestServer | | `Breakdance.DotHttp` | `.http` file parsing and test base class | | `Breakdance.Assemblies` | Response snapshot handlers | # Snapshots: Test Real Things Source: https://easyaf.dev/breakdance/guides/web/snapshots/index Capture and replay real HTTP requests and responses for fast, deterministic, and reliable API testing. Breakdance is built on a simple philosophy: **Test Real Things**. Traditional mocking creates a parallel universe where your tests pass but your code might still fail in production. Mocks require you to maintain fake implementations that can drift from reality. They obscure real problems and introduce artificial complexity. Snapshots are different. They capture actual HTTP traffic from real APIs and replay it in your tests. Your tests exercise the same code paths, parse the same JSON structures, and handle the same edge cases as production. When the real API changes, your snapshots reveal the difference immediately. ## What Are Snapshots? Breakdance uses the term "snapshot" to describe captured HTTP traffic that can be replayed during testing: **`.http` files** containing real HTTP requests you want to replay. Capture requests from browser DevTools, API documentation, or your own exploration. Define them once, run them everywhere. **Response files** containing real HTTP responses from APIs. Capture responses once from a real API, then replay them instantly without network calls. ## Why Snapshots Beat Mocks | Aspect | Traditional Mocks | Snapshots | | - | - | - | | **Source of truth** | Developer imagination | Real API behavior | | **Maintenance** | Manual updates required | Re-capture when API changes | | **Accuracy** | Prone to drift | Always reflects reality | | **Edge cases** | Often forgotten | Naturally captured | | **Test confidence** | "Works with mocks" | "Works with real data" | | **Debugging** | Artificial scenarios | Real-world scenarios | ## The Snapshot Workflow Record real HTTP traffic from the actual API. This happens once per endpoint or when the API changes. * For **requests**: Copy from browser DevTools, API docs, or write `.http` files * For **responses**: Run your code against the real API with capture enabled Check snapshot files into source control alongside your tests. They become part of your test fixtures. Tests read from snapshot files instead of making network calls. Fast, deterministic, and offline-capable. When APIs change, re-capture snapshots. Your tests immediately reveal any breaking changes. ## When to Use Each Type ### Request Snapshots (`.http` files) Use request snapshots when you want to: * Document API contracts in a readable format * Share request examples with your team * Test multiple variations of the same endpoint * Chain requests together (login → get profile → update settings) * Use environment-specific variables (dev/staging/prod URLs) ```http users.http theme={"dark"} @baseUrl = https://api.example.com ### Get all users GET {{baseUrl}}/users Accept: application/json ### Get specific user GET {{baseUrl}}/users/123 Accept: application/json ``` ### Response Snapshots Use response snapshots when you want to: * Test against third-party APIs without hitting rate limits * Run tests offline or in CI environments without API access * Ensure deterministic test data (same response every time) * Test error handling with captured error responses * Avoid polluting real accounts with test data ```csharp theme={"dark"} // Responses served from files, no network calls var handler = new ResponseSnapshotReplayHandler("Snapshots"); var client = new HttpClient(handler); var response = await client.GetAsync("https://api.example.com/users"); // Response loaded from Snapshots/api.example.com/users.json ``` ## Combining Both Approaches The real power comes from combining request and response snapshots: ```csharp theme={"dark"} public class UserApiTests : DotHttpTestBase { protected override HttpMessageHandler CreateHttpMessageHandler() { // Replay captured responses return new ResponseSnapshotReplayHandler("ResponseSnapshots"); } [TestMethod] public async Task GetUsers_ReturnsExpectedData() { // Request defined in .http format SetVariable("baseUrl", "https://api.example.com"); var request = new DotHttpRequest { Method = "GET", Url = "{{baseUrl}}/users" }; // Request format from .http, response from snapshot file var response = await SendRequestAsync(request); await DotHttpAssertions.AssertValidResponseAsync(response); } } ``` This gives you: * **Readable requests** in `.http` format with variables and chaining * **Real responses** captured from actual API calls * **Fast execution** with no network overhead * **Deterministic results** for reliable CI/CD ## Getting Started Learn how to write and execute `.http` files as unit tests Learn how to capture and replay HTTP responses ## Related Packages | Package | Purpose | | - | - | | `Breakdance.DotHttp` | Request snapshots via `.http` file parsing | | `Breakdance.Assemblies` | Response snapshot handlers | # Testing with .http Files Source: https://easyaf.dev/breakdance/guides/web/snapshots/requests Write API tests using Visual Studio's .http file format with variables, environments, and request chaining. The `.http` file format lets you define HTTP requests in a readable text format. Breakdance's DotHttp library provides a runtime and source generator to execute these files as unit tests, with full support for variables, environments, and request chaining. ## Prerequisites Add the Breakdance DotHttp package to your test project: ```bash theme={"dark"} dotnet add package Breakdance.DotHttp ``` Add a `.http` file to your project. Visual Studio and VS Code provide syntax highlighting. ## Quick Start Create a test class that inherits from `DotHttpTestBase`: ```csharp ApiTests.cs theme={"dark"} using CloudNimble.Breakdance.DotHttp; using CloudNimble.Breakdance.DotHttp.Models; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Net.Http; using System.Threading.Tasks; [TestClass] public class ApiTests : DotHttpTestBase { [TestMethod] public async Task GetUsers_ReturnsSuccess() { SetVariable("baseUrl", "https://jsonplaceholder.typicode.com"); var request = new DotHttpRequest { Method = "GET", Url = "{{baseUrl}}/users", Name = "getUsers" }; var response = await SendRequestAsync(request); Assert.IsTrue(response.IsSuccessStatusCode); } } ``` While you can manually construct `DotHttpRequest` objects, the real power comes from parsing `.http` files or using the source generator to create tests automatically. ## The .http File Format A `.http` file contains one or more HTTP requests separated by `###`: ```http api.http theme={"dark"} ### Get all users GET https://api.example.com/users Accept: application/json ### Create a user POST https://api.example.com/users Content-Type: application/json { "name": "John Doe", "email": "john@example.com" } ### Get a specific user GET https://api.example.com/users/1 ``` Each request section includes: * An optional comment line starting with `#` or `//` * The HTTP method and URL * Optional headers (key: value format) * A blank line separating headers from body * An optional request body ## Variables Variables make your requests dynamic and reusable. ### Defining Variables Define variables at the top of your `.http` file using `@variable = value`: ```http theme={"dark"} @baseUrl = https://api.example.com @apiKey = my-secret-key ### Use variables in requests GET {{baseUrl}}/users Authorization: Bearer {{apiKey}} ``` ### Setting Variables in Code ```csharp theme={"dark"} [TestMethod] public async Task GetUsers_WithApiKey() { SetVariable("baseUrl", "https://api.example.com"); SetVariable("apiKey", Configuration["ApiKey"]); // From test config var response = await SendRequestAsync(request); Assert.IsTrue(response.IsSuccessStatusCode); } ``` ### Dynamic Variables Breakdance supports dynamic variables that generate values at runtime: | Variable | Description | Example Output | | - | - | - | | `{{$guid}}` | New GUID | `550e8400-e29b-41d4-a716-446655440000` | | `{{$datetime}}` | UTC datetime (ISO 8601) | `2024-01-15T10:30:00Z` | | `{{$localDatetime}}` | Local datetime with timezone | `2024-01-15T10:30:00-05:00` | | `{{$timestamp}}` | Unix timestamp | `1705315800` | | `{{$randomInt}}` | Random integer | `42987` | | `{{$randomInt 100}}` | Random 0-100 | `73` | | `{{$randomInt 10 50}}` | Random 10-50 | `34` | | `{{$processEnv VAR}}` | Environment variable | Value of \$VAR | ```http theme={"dark"} ### Create unique resource POST {{baseUrl}}/items Content-Type: application/json { "id": "{{$guid}}", "timestamp": "{{$datetime}}", "sequence": {{$randomInt 1000}} } ``` ### DateTime Formatting and Offsets Dynamic datetime variables support formatting and offsets: ```http theme={"dark"} ### Datetime with format # ISO 8601 (default) GET {{baseUrl}}/reports?from={{$datetime}} # RFC 1123 format GET {{baseUrl}}/reports?from={{$datetime rfc1123}} # Custom format GET {{baseUrl}}/reports?from={{$datetime "dd-MM-yyyy"}} ### Datetime with offset # Tomorrow GET {{baseUrl}}/reports?until={{$datetime 1 d}} # One week ago GET {{baseUrl}}/reports?from={{$datetime -7 d}} # In 1 hour GET {{baseUrl}}/tokens?expires={{$timestamp 1 h}} ``` **Offset units:** `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours), `d` (days), `w` (weeks), `M` (months), `y` (years) ## Environment Files Store environment-specific variables in `http-client.env.json`: ```json http-client.env.json theme={"dark"} { "$shared": { "apiVersion": "v2" }, "dev": { "baseUrl": "https://localhost:5001", "apiKey": "dev-key-123" }, "staging": { "baseUrl": "https://staging.api.example.com", "apiKey": "staging-key-456" }, "prod": { "baseUrl": "https://api.example.com", "apiKey": "prod-key-789" } } ``` Load environments in your tests: ```csharp theme={"dark"} [TestInitialize] public void Setup() { LoadEnvironment("http-client.env.json", "dev"); } [TestMethod] public async Task CanSwitchEnvironments() { // Start with dev LoadEnvironment("http-client.env.json", "dev"); var devResponse = await SendRequestAsync(request); // Switch to staging SwitchEnvironment("staging"); var stagingResponse = await SendRequestAsync(request); } ``` ### User Overrides Keep secrets out of source control with `.user` files: ```json http-client.env.json.user theme={"dark"} { "dev": { "apiKey": "my-personal-dev-key" } } ``` ```csharp theme={"dark"} LoadEnvironmentWithOverrides( "http-client.env.json", "http-client.env.json.user", "dev"); ``` Add `*.user` files to your `.gitignore` to prevent committing secrets. ## Request Chaining Chain requests together by capturing responses and referencing them in subsequent requests. ### Naming Requests Use `# @name` to give a request a name for later reference: ```http theme={"dark"} ### Login to get a token # @name login POST {{baseUrl}}/auth/login Content-Type: application/json {"username": "test", "password": "secret"} ### Use the token from login GET {{baseUrl}}/users/me Authorization: Bearer {{login.response.body.$.token}} ``` ### Response Reference Syntax | Reference | Description | | - | - | | `{{name.response.body.*}}` | Entire response body | | `{{name.response.body.$.path}}` | JSONPath extraction | | `{{name.response.body./xpath}}` | XPath for XML | | `{{name.response.headers.HeaderName}}` | Response header value | | `{{name.request.body.*}}` | Original request body | ### JSONPath Examples ```http theme={"dark"} ### Login request # @name login POST {{baseUrl}}/auth Content-Type: application/json {"username": "admin", "password": "secret"} ### Get user profile using extracted userId GET {{baseUrl}}/users/{{login.response.body.$.user.id}} Authorization: Bearer {{login.response.body.$.token}} ### Create order with user's default address # @name createOrder POST {{baseUrl}}/orders Content-Type: application/json X-Request-Id: {{login.response.headers.X-Request-Id}} { "userId": "{{login.response.body.$.user.id}}", "items": [{"productId": "123", "quantity": 1}] } ``` ### Chaining in Code ```csharp theme={"dark"} [TestMethod] public async Task ChainedRequests_UseResponseData() { // First request - login var loginRequest = new DotHttpRequest { Method = "POST", Url = "{{baseUrl}}/auth/login", Name = "login", Body = "{\"username\": \"test\", \"password\": \"secret\"}", Headers = { ["Content-Type"] = "application/json" } }; await SendRequestAsync(loginRequest); // Second request - uses token from login response var profileRequest = new DotHttpRequest { Method = "GET", Url = "{{baseUrl}}/users/me", Headers = { ["Authorization"] = "Bearer {{login.response.body.$.token}}" } }; var response = await SendRequestAsync(profileRequest); Assert.IsTrue(response.IsSuccessStatusCode); } ``` ## Smart Assertions Go beyond simple status code checking with `DotHttpAssertions`: ```csharp theme={"dark"} using CloudNimble.Breakdance.DotHttp; [TestMethod] public async Task ValidateApiContract() { var response = await SendRequestAsync(request); // Comprehensive validation in one call await DotHttpAssertions.AssertValidResponseAsync(response, checkStatusCode: true, // Verify 2xx status checkContentType: true, // Ensure Content-Type header present checkBodyForErrors: true, // Detect error patterns in 200 responses logResponseOnFailure: true);// Include body in error messages } [TestMethod] public async Task AssertSpecificConditions() { var response = await SendRequestAsync(request); // Check specific status code await DotHttpAssertions.AssertStatusCodeAsync(response, 201); // Verify Content-Type DotHttpAssertions.AssertContentType(response, "application/json"); // Check for specific header DotHttpAssertions.AssertHeader(response, "X-Request-Id"); DotHttpAssertions.AssertHeader(response, "Cache-Control", "no-store"); // Verify body contains expected text await DotHttpAssertions.AssertBodyContainsAsync(response, "\"success\":true"); // Detect hidden errors (200 OK with error payload) await DotHttpAssertions.AssertNoErrorsInBodyAsync(response); } ``` ### Error Pattern Detection `AssertNoErrorsInBodyAsync` catches common API anti-patterns where an error is returned with a 200 status: ```json theme={"dark"} // This 200 OK response would fail the assertion { "error": "User not found", "success": false } ``` Detected patterns: * `"error":` or `"errors":` fields * `"success":false` or `"status":"error"` * XML `` elements * `"fault":` fields ## Using with Response Caching Combine DotHttp testing with cached responses for deterministic tests: ```csharp theme={"dark"} public class CachedApiTests : DotHttpTestBase { protected override HttpMessageHandler CreateHttpMessageHandler() { // Serve responses from cached files instead of real API return new TestCacheReadDelegatingHandler("ResponseFiles"); } [TestMethod] public async Task GetUsers_UseCachedResponse() { SetVariable("baseUrl", "https://api.example.com"); var response = await SendRequestAsync(new DotHttpRequest { Method = "GET", Url = "{{baseUrl}}/users" }); // Response comes from ResponseFiles/api.example.com/users.json Assert.IsTrue(response.IsSuccessStatusCode); } } ``` See the [Response Caching guide](/breakdance/guides/response-caching) for details on capturing and serving cached responses. ## Parsing .http Files Use `DotHttpFileParser` to parse existing `.http` files: ```csharp theme={"dark"} [TestMethod] public async Task ExecuteAllRequestsFromFile() { var parser = new DotHttpFileParser(); var httpFile = parser.ParseFile("api.http"); foreach (var request in httpFile.Requests) { var response = await SendRequestAsync(request); await DotHttpAssertions.AssertValidResponseAsync(response); } } ``` ## Related Resources Capture and replay HTTP responses for deterministic tests Test ASP.NET Web API controllers without a server # Response Snapshots Source: https://easyaf.dev/breakdance/guides/web/snapshots/responses Capture real HTTP responses from APIs and replay them in tests for fast, deterministic, and offline-capable testing. Response snapshots let you capture actual HTTP responses from real APIs, then replay them during test execution. Instead of maintaining hand-crafted mock responses that might drift from reality, you test against the same data your production code will encounter. ## Why Use Response Snapshots? Tests run instantly by reading from disk instead of making network calls Tests pass consistently without API availability or rate limiting issues Run your test suite anywhere, even without internet access No secrets or API credentials needed in your build pipeline ## How It Works Breakdance provides two `DelegatingHandler` classes for the snapshot workflow: | Handler | Purpose | | - | - | | `ResponseSnapshotCaptureHandler` | Makes real HTTP calls and saves responses to files | | `ResponseSnapshotReplayHandler` | Reads responses from files instead of making HTTP calls | The workflow: 1. Run tests once with the **Capture** handler to record real responses 2. Check captured response files into source control 3. Run tests with the **Replay** handler for fast, deterministic execution ## Quick Start ```bash theme={"dark"} dotnet add package Breakdance.Assemblies ``` ``` MyProject.Tests/ ResponseSnapshots/ (captured responses go here) ``` Run your tests with the Capture handler to record real API responses. Change to the Replay handler for subsequent test runs. ## Capturing Responses Use `ResponseSnapshotCaptureHandler` to capture real API responses: ```csharp ApiCaptureTests.cs theme={"dark"} using CloudNimble.Breakdance.Assemblies.Http; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Net.Http; using System.Threading.Tasks; [TestClass] public class ApiCaptureTests { [TestMethod] public async Task CaptureUserEndpoint() { // Create handler that will save responses to ResponseSnapshots folder var handler = new ResponseSnapshotCaptureHandler("ResponseSnapshots") { InnerHandler = new HttpClientHandler() }; var client = new HttpClient(handler); // This makes a real HTTP call and saves the response var response = await client.GetAsync("https://jsonplaceholder.typicode.com/users"); Assert.IsTrue(response.IsSuccessStatusCode); } } ``` After running this test, you'll have: ``` ResponseSnapshots/ jsonplaceholder.typicode.com/ users.json ``` Run capture tests once, then check the `ResponseSnapshots` folder into source control. This lets your entire team (and CI) run tests without API access. ## Replaying Responses Switch to `ResponseSnapshotReplayHandler` to serve captured responses: ```csharp ApiTests.cs theme={"dark"} using CloudNimble.Breakdance.Assemblies.Http; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Net.Http; using System.Threading.Tasks; [TestClass] public class ApiTests { [TestMethod] public async Task GetUsers_FromSnapshot() { // Create handler that reads from ResponseSnapshots folder var handler = new ResponseSnapshotReplayHandler("ResponseSnapshots"); var client = new HttpClient(handler); // This reads from file, no network call var response = await client.GetAsync("https://jsonplaceholder.typicode.com/users"); Assert.IsTrue(response.IsSuccessStatusCode); var content = await response.Content.ReadAsStringAsync(); Assert.IsFalse(string.IsNullOrWhiteSpace(content)); } } ``` The Replay handler throws `InvalidOperationException` if a snapshot file doesn't exist. This helps catch missing captures early. ## File Organization Responses are organized by host and path: | Request URL | File Path | | - | - | | `https://api.example.com/users` | `ResponseSnapshots/api.example.com/users.json` | | `https://api.example.com/users/123` | `ResponseSnapshots/api.example.com/users/123.json` | | `https://api.example.com/v1/items?type=active` | `ResponseSnapshots/api.example.com/v1/items.json` | The file extension is determined by the response's Content-Type: * `application/json` → `.json` * `application/xml` or `text/xml` → `.xml` * `text/html` → `.html` * Others → `.txt` ## Using with DotHttpTestBase Combine response snapshots with request snapshots (`.http` files) for comprehensive testing: ```csharp theme={"dark"} using CloudNimble.Breakdance.DotHttp; using CloudNimble.Breakdance.Assemblies.Http; public class CachedApiTests : DotHttpTestBase { protected override HttpMessageHandler CreateHttpMessageHandler() { return new ResponseSnapshotReplayHandler("ResponseSnapshots"); } [TestMethod] public async Task GetUsers_Test() { SetVariable("baseUrl", "https://api.example.com"); var request = new DotHttpRequest { Method = "GET", Url = "{{baseUrl}}/users" }; // Response served from ResponseSnapshots/api.example.com/users.json var response = await SendRequestAsync(request); await DotHttpAssertions.AssertValidResponseAsync(response); } } ``` ## Capture/Replay Pattern A common pattern is to have separate capture and test modes: ```csharp theme={"dark"} public abstract class ApiTestBase : DotHttpTestBase { // Toggle this to switch between capture and replay modes protected virtual bool CaptureMode => false; protected override HttpMessageHandler CreateHttpMessageHandler() { if (CaptureMode) { return new ResponseSnapshotCaptureHandler("ResponseSnapshots") { InnerHandler = new HttpClientHandler() }; } return new ResponseSnapshotReplayHandler("ResponseSnapshots"); } } // For normal test runs (replayed responses) [TestClass] public class UserApiTests : ApiTestBase { // Uses replayed responses by default } // For capturing fresh responses [TestClass] [Ignore("Run manually to refresh response snapshots")] public class UserApiCapture : ApiTestBase { protected override bool CaptureMode => true; } ``` ## Environment-Specific Responses Capture responses per environment for different test scenarios: ```csharp theme={"dark"} public class MultiEnvironmentTests : DotHttpTestBase { private readonly string _environment; public MultiEnvironmentTests() { _environment = Environment.GetEnvironmentVariable("TEST_ENV") ?? "default"; } protected override HttpMessageHandler CreateHttpMessageHandler() { var folder = $"ResponseSnapshots/{_environment}"; return new ResponseSnapshotReplayHandler(folder); } } ``` Directory structure: ``` ResponseSnapshots/ default/ api.example.com/ users.json error-scenarios/ api.example.com/ users.json (contains error response) empty-results/ api.example.com/ users.json (contains empty array) ``` ## Testing Edge Cases Create response files manually to test specific scenarios: ```json ResponseSnapshots/error-scenarios/api.example.com/users.json theme={"dark"} { "error": "Internal server error", "code": "INTERNAL_ERROR" } ``` ```csharp theme={"dark"} [TestMethod] public async Task GetUsers_HandlesError_Gracefully() { // Point to error response file var handler = new ResponseSnapshotReplayHandler("ResponseSnapshots/error-scenarios"); var client = new HttpClient(handler); var response = await client.GetAsync("https://api.example.com/users"); var content = await response.Content.ReadAsStringAsync(); Assert.IsTrue(content.Contains("error")); } ``` ## Best Practices Response snapshot files should be committed alongside your tests. This ensures everyone on the team and your CI pipeline can run tests without API access. API responses change over time. Set a reminder to refresh your captured responses monthly or when API versions change. Be careful not to capture responses containing secrets, tokens, or personal data. Either sanitize the response files or use test accounts with non-sensitive data. Organize response files by feature or test scenario for easier maintenance: ``` ResponseSnapshots/ user-management/ order-processing/ authentication/ ``` `ResponseSnapshotCaptureHandler` includes retry logic for file locking when multiple tests run in parallel. No additional configuration needed. ## Troubleshooting The Replay handler throws `InvalidOperationException` with the expected file path. Check: * The file exists at the expected path * The URL matches exactly (including query string handling) * The ResponseSnapshots folder is copied to test output (set Copy to Output Directory) The handler sets Content-Type based on file extension. If you need a specific Content-Type, ensure your file has the correct extension (`.json`, `.xml`, etc.). Ensure snapshot files are included in your test project: ```xml theme={"dark"} ``` ## Migration from TestCache Classes If you're upgrading from an earlier version of Breakdance, the following classes have been renamed: | Old Name | New Name | | - | - | | `TestCacheWriteDelegatingHandler` | `ResponseSnapshotCaptureHandler` | | `TestCacheReadDelegatingHandler` | `ResponseSnapshotReplayHandler` | | `TestCacheDelegatingHandlerBase` | `ResponseSnapshotHandlerBase` | | `ResponseFilesPath` property | `ResponseSnapshotsPath` property | The old class names are still available but marked as `[Obsolete]` and will be removed in a future major version. ## Related Resources Write API tests using the `.http` file format Learn about the Test Real Things philosophy # Breakdance - Test Real Things Source: https://easyaf.dev/breakdance/index No Fakes. No Mocks. A .NET testing framework that eliminates the need for mocking by testing against real infrastructure.
# Better Testing in 5 Minutes with Breakdance Source: https://easyaf.dev/breakdance/quickstart Get up and running quickly is as easy as 1-2-3. # Why Breakdance? Source: https://easyaf.dev/breakdance/why-breakdance Understand the philosophy behind Test Real Things and why Breakdance eliminates mocking from your test suite. ## The Mocking Trap Every .NET developer knows the pattern: create an interface, inject dependencies, mock everything in tests. It sounds clean. It feels testable. But it creates a fundamental problem: **Your tests pass in a universe that doesn't exist.** Mocks are imagination codified. They represent what you *think* an API returns, how you *assume* an error manifests, what you *hope* the edge cases look like. When your imagination doesn't match reality, your tests become lies that pass with green checkmarks. ## The Real Cost of Mocks Every API change requires updating mock configurations across your test suite. Miss one spot, and your tests still pass while your production code fails. The larger your codebase, the more mock maintenance becomes a full-time job. Green tests feel good. They signal "everything works." But mock-based tests only prove your code works with your mocks. They say nothing about whether your code works with real services, real data, or real edge cases. Real APIs return unexpected data. Null values where you expected objects. Arrays when you expected singles. Error messages in formats you didn't anticipate. Mocks can't capture what you don't know to mock. APIs evolve. External services add fields, deprecate endpoints, change error formats. Your mocks stay frozen in time, creating an ever-widening gap between what tests verify and what production encounters. ## A Different Philosophy Breakdance is built on a simple belief: **tests should exercise real behavior, not imagined behavior.** Instead of writing mock configurations that describe what you think will happen, Breakdance helps you capture what actually happens and replay it in your tests. Record real HTTP responses, real API behaviors, real edge cases from actual systems. Store them as snapshot files alongside your tests. Your tests read from these snapshots instantly - no network calls, no rate limits, no flaky dependencies. Fast, deterministic, and offline-capable. ## What "Test Real Things" Means When you test HTTP client code, use actual responses captured from real APIs. Your code parses the same JSON, handles the same edge cases, and encounters the same quirks as production. When you test Azure Storage code, use Azurite - a real Azure Storage emulator that behaves identically to the cloud service. Not a mock, not a stub - the actual storage API. When you test ASP.NET APIs, use TestServer to run your actual middleware, routing, and controller logic in-memory. Same code, same DI container, same behavior. When you define test requests, use the `.http` file format - the same format Visual Studio and VS Code use. Human-readable, portable, and immediately executable. ## The Snapshot Workflow The Breakdance workflow replaces mock maintenance with snapshot management: ```mermaid theme={"dark"} graph LR A[Real API] -->|Capture| B[Snapshot File] B -->|Replay| C[Your Tests] C -->|Fast & Deterministic| D[CI/CD Pipeline] A -->|API Changes| E[Re-capture] E -->|Diff Reveals| F[Breaking Changes] ``` 1. **Capture**: Run your code against real APIs once. Breakdance saves responses to files. 2. **Commit**: Check snapshot files into source control with your tests. 3. **Replay**: Tests read from files instantly. No network, no secrets needed. 4. **Refresh**: When APIs change, re-capture. Git diff shows exactly what changed. ## When to Use What | Scenario | Breakdance Approach | | - | - | | Testing HTTP client code | Response Snapshots - capture and replay real API responses | | Testing your own APIs | In-memory TestServer - run your actual ASP.NET pipeline | | Testing Azure Storage | Azurite integration - real storage API, local execution | | Documenting API contracts | Request Snapshots - `.http` files that serve as tests and docs | | CI/CD without secrets | All approaches - snapshots eliminate external dependencies | ## What Breakdance Doesn't Do Breakdance isn't against all forms of test isolation. There are legitimate cases for: * **Seams for DI**: Constructor injection for swapping implementations * **In-memory databases**: EF Core's in-memory provider for data tests * **Test fixtures**: Setup and teardown for stateful resources What Breakdance eliminates is **behavioral mocking** - the practice of writing code that pretends to be something else. Instead of `mockHttp.Setup(x => x.GetAsync(...)).Returns(...)`, you capture what `GetAsync` actually returns. ## The Result Teams using Breakdance report: Snapshot replay is instant. No network latency, no external service slowdowns. Production issues that mocks would have hidden surface during development. Refreshing snapshots is faster than updating mock configurations. ## Ready to Break Free? Start with the concept that fits your current testing pain: Learn how Response Snapshots capture and replay real HTTP responses. Test your controllers with in-memory TestServer - no deployment needed. Test against real Azurite instead of mocking storage operations. Understand the complete "Test Real Things" philosophy and workflow. # ClaudeHooksJsonContext Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/ClaudeHooksJsonContext Provides AOT-compatible JSON serialization context for Claude Code hook types. This context uses source generators to pre-compile serialization c... ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Text.Json.Serialization.JsonSerializerContext ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.ClaudeHooksJsonContext ``` ## Summary Provides AOT-compatible JSON serialization context for Claude Code hook types. This context uses source generators to pre-compile serialization code, eliminating the need for runtime reflection. ## Usage `ClaudeHooksJsonContext` is a source-generated `JsonSerializerContext` that enables AOT-compatible JSON serialization. ### Direct Usage ```csharp theme={"dark"} using System.Text.Json; // Deserialize using the context directly var input = JsonSerializer.Deserialize( json, ClaudeHooksJsonContext.Default.PreToolUseHookInputObject); // Serialize using the context directly string output = JsonSerializer.Serialize( hookOutput, ClaudeHooksJsonContext.Default.PostToolUseHookOutput); ``` ### Accessing Options ```csharp theme={"dark"} // Get the configured JsonSerializerOptions JsonSerializerOptions options = ClaudeHooksJsonContext.Default.Options; ``` ### Extending for Custom Types Create your own context for strongly-typed tool inputs: ```csharp theme={"dark"} [JsonSerializable(typeof(PreToolUseHookInput))] [JsonSerializable(typeof(PreToolUseHookInput))] public partial class MyHooksJsonContext : JsonSerializerContext { } ``` ## Remarks For generic hook types (PreToolUseHookInput, PostToolUseHookInput, etc.), this context registers versions using [Object](https://learn.microsoft.com/dotnet/api/system.object) as the type parameter. If you need strongly-typed serialization for specific tool inputs/outputs, create your own [JsonSerializerContext](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonserializercontext) with additional type registrations. Usage example: ```csharp theme={"dark"} var input = JsonSerializer.Deserialize(json, ClaudeHooksJsonContext.Default.PreToolUseHookInputObject); var output = JsonSerializer.Serialize(hookOutput, ClaudeHooksJsonContext.Default.PreToolUseHookOutputObject); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ClaudeHooksJsonContext() ``` ### .ctor #### Syntax ```csharp theme={"dark"} public ClaudeHooksJsonContext(System.Text.Json.JsonSerializerOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `System.Text.Json.JsonSerializerOptions` | - | ## Properties ### BashPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo BashPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### BashPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo BashPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### BashToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo BashToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### BashToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo BashToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### Boolean Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo Boolean { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### CompactTrigger Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo CompactTrigger { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### Default The default [JsonSerializerContext](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonserializercontext) associated with a default [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) instance. #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.ClaudeHooksJsonContext Default { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.ClaudeHooksJsonContext` ### DictionaryStringInt32 Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> DictionaryStringInt32 { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### Double Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo Double { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### EditPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo EditPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### EditPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo EditPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### EditToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo EditToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### EditToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo EditToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GlobPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GlobPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GlobPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GlobPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GlobToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GlobToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GlobToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GlobToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GrepPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GrepPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GrepPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GrepPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GrepToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GrepToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### GrepToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo GrepToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### HookDecision Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo HookDecision { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### HookEventName Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo HookEventName { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### Int32 Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo Int32 { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### JsonElement Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo JsonElement { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### KillShellPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo KillShellPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### KillShellPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo KillShellPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### KillShellToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo KillShellToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### KillShellToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo KillShellToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### ListString Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListString { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### ListStructuredPatchHunk Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListStructuredPatchHunk { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### ListTodoItem Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListTodoItem { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### ListWebSearchResultContainer Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListWebSearchResultContainer { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### ListWebSearchResultItem Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListWebSearchResultItem { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### NotebookEditPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo NotebookEditPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### NotebookEditPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo NotebookEditPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### NotebookEditToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo NotebookEditToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### NotebookEditToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo NotebookEditToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### NotificationHookInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo NotificationHookInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### NotificationHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo NotificationHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### NotificationType Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo NotificationType { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### NullableBoolean Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> NullableBoolean { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### NullableDouble Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> NullableDouble { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### NullableHookDecision Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> NullableHookDecision { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### NullableInt32 Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> NullableInt32 { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### NullablePermissionDecision Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> NullablePermissionDecision { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### Object Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo Object { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PermissionDecision Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo PermissionDecision { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PermissionMode Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo PermissionMode { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PermissionRequestBehavior Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo PermissionRequestBehavior { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PermissionRequestDecisionObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PermissionRequestDecisionObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### PermissionRequestHookInputObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PermissionRequestHookInputObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### PermissionRequestHookOutputObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PermissionRequestHookOutputObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### PermissionRequestSpecificOutputObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PermissionRequestSpecificOutputObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### PostToolUseHookInputObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PostToolUseHookInputObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### PostToolUseHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo PostToolUseHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PostToolUseSpecificOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo PostToolUseSpecificOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PreCompactHookInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo PreCompactHookInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PreCompactHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo PreCompactHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### PreToolUseHookInputObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PreToolUseHookInputObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### PreToolUseHookOutputObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PreToolUseHookOutputObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### PreToolUseSpecificOutputObject Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo> PreToolUseSpecificOutputObject { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` ### ReadPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo ReadPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### ReadPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo ReadPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### ReadToolFileInfo Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo ReadToolFileInfo { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### ReadToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo ReadToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### ReadToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo ReadToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SessionEndHookInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SessionEndHookInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SessionEndHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SessionEndHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SessionEndReason Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SessionEndReason { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SessionStartHookInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SessionStartHookInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SessionStartHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SessionStartHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SessionStartSource Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SessionStartSource { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SessionStartSpecificOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SessionStartSpecificOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### StopHookInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo StopHookInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### StopHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo StopHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### String Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo String { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### StringArray Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo StringArray { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### StructuredPatchHunk Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo StructuredPatchHunk { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SubagentStopHookInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SubagentStopHookInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### SubagentStopHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo SubagentStopHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TaskPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TaskPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TaskPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TaskPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TaskToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TaskToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TaskToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TaskToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TodoItem Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TodoItem { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TodoItemArray Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TodoItemArray { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TodoWritePostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TodoWritePostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TodoWritePreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TodoWritePreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TodoWriteToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TodoWriteToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### TodoWriteToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo TodoWriteToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### UserPromptSubmitHookInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo UserPromptSubmitHookInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### UserPromptSubmitHookOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo UserPromptSubmitHookOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### UserPromptSubmitSpecificOutput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo UserPromptSubmitSpecificOutput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebFetchPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebFetchPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebFetchPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebFetchPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebFetchToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebFetchToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebFetchToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebFetchToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebSearchPostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebSearchPostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebSearchPreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebSearchPreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebSearchResultContainer Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebSearchResultContainer { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebSearchResultItem Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebSearchResultItem { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebSearchToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebSearchToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WebSearchToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WebSearchToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WritePostToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WritePostToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WritePreToolUsePayload Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WritePreToolUsePayload { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WriteToolInput Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WriteToolInput { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ### WriteToolResponse Defines the source generated JSON serialization contract metadata for a given type. #### Syntax ```csharp theme={"dark"} public System.Text.Json.Serialization.Metadata.JsonTypeInfo WriteToolResponse { get; } ``` #### Property Value Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo` ## Methods ### GetTypeInfo Override #### Syntax ```csharp theme={"dark"} public override System.Text.Json.Serialization.Metadata.JsonTypeInfo GetTypeInfo(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | - | #### Returns Type: `System.Text.Json.Serialization.Metadata.JsonTypeInfo?` ## Related APIs * System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver # ClaudeHooksSerializer Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/ClaudeHooksSerializer Provides static helper methods for serializing and deserializing Claude Code hook types. All methods use the AOT-compatible [ClaudeHooksJsonConte... ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.ClaudeHooksSerializer ``` ## Summary Provides static helper methods for serializing and deserializing Claude Code hook types. All methods use the AOT-compatible [ClaudeHooksJsonContext](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/ClaudeHooksJsonContext) for serialization. ## Usage `ClaudeHooksSerializer` provides AOT-compatible static methods for JSON serialization using source-generated contexts. ### Deserializing Input ```csharp theme={"dark"} // Read and deserialize from stdin string json = Console.In.ReadToEnd(); var preToolUse = ClaudeHooksSerializer.DeserializePreToolUseInput(json); var postToolUse = ClaudeHooksSerializer.DeserializePostToolUseInput(json); var stop = ClaudeHooksSerializer.DeserializeStopInput(json); var notification = ClaudeHooksSerializer.DeserializeNotificationInput(json); ``` ### Serializing Output ```csharp theme={"dark"} // Create and serialize output var output = new PreToolUseHookOutput { Continue = true }; string json = ClaudeHooksSerializer.SerializePreToolUseOutput(output); Console.WriteLine(json); ``` ### Using Custom Types For strongly-typed tool inputs, create your own `JsonSerializerContext`: ```csharp theme={"dark"} [JsonSerializable(typeof(PreToolUseHookInput))] public partial class MyJsonContext : JsonSerializerContext { } var input = ClaudeHooksSerializer.DeserializePreToolUseInput( json, MyJsonContext.Default.PreToolUseHookInputMyToolInput); ``` ## Properties ### DefaultOptions Gets the default [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) configured for Claude Code hooks. This instance is configured with the [ClaudeHooksJsonContext](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/ClaudeHooksJsonContext) for AOT compatibility. #### Syntax ```csharp theme={"dark"} public static System.Text.Json.JsonSerializerOptions DefaultOptions { get; } ``` #### Property Value Type: `System.Text.Json.JsonSerializerOptions` ## Methods ### DeserializeNotificationInput Deserializes a JSON string to a [NotificationHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/NotificationHookInput). #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.NotificationHookInput DeserializeNotificationInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.NotificationHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializePermissionRequestInput Deserializes a JSON string to a `PermissionRequestHookInput`1\` with dynamic tool input. #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.PermissionRequestHookInput DeserializePermissionRequestInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.PermissionRequestHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializePostToolUseInput Deserializes a JSON string to a `PostToolUseHookInput`2\` with dynamic types. #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput DeserializePostToolUseInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializePostToolUseInput Deserializes a JSON string to a `PostToolUseHookInput`2\` with specific types. #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput DeserializePostToolUseInput(string json, System.Text.Json.Serialization.Metadata.JsonTypeInfo> typeInfo) where TToolInput : class where TToolResponse : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | | `typeInfo` | `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` | The JSON type info for the specific input type. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput?` The deserialized hook input, or null if deserialization fails. #### Type Parameters * `TToolInput` - The type of the tool input. * `TToolResponse` - The type of the tool response. ### DeserializePreCompactInput Deserializes a JSON string to a [PreCompactHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PreCompactHookInput). #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.PreCompactHookInput DeserializePreCompactInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreCompactHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializePreToolUseInput Deserializes a JSON string to a `PreToolUseHookInput`1\` with dynamic tool input. #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput DeserializePreToolUseInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializePreToolUseInput Deserializes a JSON string to a `PreToolUseHookInput`1\` with a specific tool input type. #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput DeserializePreToolUseInput(string json, System.Text.Json.Serialization.Metadata.JsonTypeInfo> typeInfo) where TToolInput : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | | `typeInfo` | `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` | The JSON type info for the specific input type. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput?` The deserialized hook input, or null if deserialization fails. #### Type Parameters * `TToolInput` - The type of the tool input. ### DeserializeSessionEndInput Deserializes a JSON string to a [SessionEndHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SessionEndHookInput). #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionEndHookInput DeserializeSessionEndInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionEndHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializeSessionStartInput Deserializes a JSON string to a [SessionStartHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SessionStartHookInput). #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionStartHookInput DeserializeSessionStartInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionStartHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializeStopInput Deserializes a JSON string to a [StopHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/StopHookInput). #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.StopHookInput DeserializeStopInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.StopHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializeSubagentStopInput Deserializes a JSON string to a [SubagentStopHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SubagentStopHookInput). #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.SubagentStopHookInput DeserializeSubagentStopInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.SubagentStopHookInput?` The deserialized hook input, or null if deserialization fails. ### DeserializeUserPromptSubmitInput Deserializes a JSON string to a [UserPromptSubmitHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/UserPromptSubmitHookInput). #### Syntax ```csharp theme={"dark"} public static CloudNimble.ClaudeEssentials.Hooks.Inputs.UserPromptSubmitHookInput DeserializeUserPromptSubmitInput(string json) ``` #### Parameters | Name | Type | Description | | - | - | - | | `json` | `string` | The JSON string to deserialize. | #### Returns Type: `CloudNimble.ClaudeEssentials.Hooks.Inputs.UserPromptSubmitHookInput?` The deserialized hook input, or null if deserialization fails. ### SerializeNotificationOutput Serializes a [NotificationHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/NotificationHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializeNotificationOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.NotificationHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.NotificationHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializePermissionRequestOutput Serializes a `PermissionRequestHookOutput`1\` with dynamic tool input to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializePermissionRequestOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializePostToolUseOutput Serializes a [PostToolUseHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PostToolUseHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializePostToolUseOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializePreCompactOutput Serializes a [PreCompactHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PreCompactHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializePreCompactOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.PreCompactHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.PreCompactHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializePreToolUseOutput Serializes a `PreToolUseHookOutput`1\` with dynamic tool input to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializePreToolUseOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializePreToolUseOutput Serializes a `PreToolUseHookOutput`1\` with a specific tool input type to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializePreToolUseOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput output, System.Text.Json.Serialization.Metadata.JsonTypeInfo> typeInfo) where TToolInput : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput` | The hook output to serialize. | | `typeInfo` | `System.Text.Json.Serialization.Metadata.JsonTypeInfo>` | The JSON type info for the specific output type. | #### Returns Type: `string` The JSON string representation. #### Type Parameters * `TToolInput` - The type of the tool input. ### SerializeSessionEndOutput Serializes a [SessionEndHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionEndHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializeSessionEndOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionEndHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionEndHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializeSessionStartOutput Serializes a [SessionStartHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionStartHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializeSessionStartOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializeStopOutput Serializes a [StopHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/StopHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializeStopOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.StopHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.StopHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializeSubagentStopOutput Serializes a [SubagentStopHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SubagentStopHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializeSubagentStopOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.SubagentStopHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.SubagentStopHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. ### SerializeUserPromptSubmitOutput Serializes a [UserPromptSubmitHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/UserPromptSubmitHookOutput) to JSON. #### Syntax ```csharp theme={"dark"} public static string SerializeUserPromptSubmitOutput(CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitHookOutput output) ``` #### Parameters | Name | Type | Description | | - | - | - | | `output` | `CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitHookOutput` | The hook output to serialize. | #### Returns Type: `string` The JSON string representation. # CompactTrigger Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/CompactTrigger Represents what triggered a compact operation. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.CompactTrigger ``` ## Summary Represents what triggered a compact operation. ## Values | Name | Value | Description | | - | - | - | | `Manual` | 0 | Compact was triggered manually by the user. | | `Auto` | 1 | Compact was triggered automatically by the system. | # HookDecision Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookDecision Represents a hook's decision to block or allow an operation. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.HookDecision ``` ## Summary Represents a hook's decision to block or allow an operation. ## Values | Name | Value | Description | | - | - | - | | `Allow` | 0 | Allow the operation to proceed normally. | | `Block` | 1 | Block the operation from proceeding. | # HookEventName Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookEventName Represents the different types of hook events that can be triggered in Claude Code. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.HookEventName ``` ## Summary Represents the different types of hook events that can be triggered in Claude Code. ## Values | Name | Value | Description | | - | - | - | | `PreToolUse` | 0 | Runs before tool calls are executed. Can be used to block or modify tool inputs. | | `PermissionRequest` | 1 | Runs when a permission dialog is shown. Can be used to automatically allow or deny permissions. | | `PostToolUse` | 2 | Runs after tool calls complete. Can be used to inspect results or provide additional context. | | `UserPromptSubmit` | 3 | Runs when the user submits a prompt, before Claude processes it. | | `Notification` | 4 | Runs when Claude Code sends notifications. | | `Stop` | 5 | Runs when Claude Code finishes responding. | | `SubagentStop` | 6 | Runs when subagent tasks complete. | | `PreCompact` | 7 | Runs before a compact operation. | | `SessionStart` | 8 | Runs when Claude Code starts a new session or resumes one. | | `SessionEnd` | 9 | Runs when a Claude Code session ends. | # HookInputBase Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/HookInputBase Base class containing common fields present in all hook inputs. All hooks receive these fields via JSON through stdin. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ``` ## Summary Base class containing common fields present in all hook inputs. All hooks receive these fields via JSON through stdin. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NotificationHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/NotificationHookInput Represents the input received by a Notification hook. This hook runs when Claude Code sends notifications. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.NotificationHookInput ``` ## Summary Represents the input received by a Notification hook. This hook runs when Claude Code sends notifications. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NotificationHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### Message Gets or sets the notification message content. For example: "Claude needs your permission to use Bash". #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string` ### NotificationType Gets or sets the type of notification being sent. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.NotificationType NotificationType { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.NotificationType` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PermissionRequestHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PermissionRequestHookInput Represents the input received by a PermissionRequest hook. This hook runs when a permission dialog is shown and can automatically allow or deny p... ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.PermissionRequestHookInput ``` ## Summary Represents the input received by a PermissionRequest hook. This hook runs when a permission dialog is shown and can automatically allow or deny permissions. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PermissionRequestHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### Message Gets or sets the message displayed in the permission dialog. #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string?` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public TToolInput ToolInput { get; set; } ``` #### Property Value Type: `TToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PostToolUseHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PostToolUseHookInput Represents the input received by a PostToolUse hook. This hook runs after tool calls complete and includes the tool's response. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput ``` ## Summary Represents the input received by a PostToolUse hook. This hook runs after tool calls complete and includes the tool's response. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. * `TToolResponse` - The type representing the tool's response data. Use a specific tool response class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic responses. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public TToolInput ToolInput { get; set; } ``` #### Property Value Type: `TToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public TToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `TToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PreCompactHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PreCompactHookInput Represents the input received by a PreCompact hook. This hook runs before a compact operation. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.PreCompactHookInput ``` ## Summary Represents the input received by a PreCompact hook. This hook runs before a compact operation. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PreCompactHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### CustomInstructions Gets or sets custom instructions for the compact operation. Only set when the trigger is [CompactTrigger.Manual](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/CompactTrigger#manual). #### Syntax ```csharp theme={"dark"} public string CustomInstructions { get; set; } ``` #### Property Value Type: `string?` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ### Trigger Gets or sets what triggered the compact operation. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.CompactTrigger Trigger { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.CompactTrigger?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PreToolUseHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PreToolUseHookInput Represents the input received by a PreToolUse hook. This hook runs before tool calls are executed and can block or modify them. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput ``` ## Summary Represents the input received by a PreToolUse hook. This hook runs before tool calls are executed and can block or modify them. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public TToolInput ToolInput { get; set; } ``` #### Property Value Type: `TToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SessionEndHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SessionEndHookInput Represents the input received by a SessionEnd hook. This hook runs when a Claude Code session ends. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionEndHookInput ``` ## Summary Represents the input received by a SessionEnd hook. This hook runs when a Claude Code session ends. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SessionEndHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### Reason Gets or sets the reason why the session ended. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.SessionEndReason Reason { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.SessionEndReason` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SessionStartHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SessionStartHookInput Represents the input received by a SessionStart hook. This hook runs when Claude Code starts a new session or resumes one. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionStartHookInput ``` ## Summary Represents the input received by a SessionStart hook. This hook runs when Claude Code starts a new session or resumes one. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SessionStartHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### EnvironmentFilePath Gets or sets the file path where environment variables can be persisted. This file can be written to during SessionStart to set environment variables that will be available throughout the session. #### Syntax ```csharp theme={"dark"} public string EnvironmentFilePath { get; set; } ``` #### Property Value Type: `string?` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### Source Gets or sets the source that triggered the session start. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.SessionStartSource Source { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.SessionStartSource?` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # StopHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/StopHookInput Represents the input received by a Stop hook. This hook runs when Claude Code finishes responding. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.StopHookInput ``` ## Summary Represents the input received by a Stop hook. This hook runs when Claude Code finishes responding. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public StopHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### StopHookActive Gets or sets a value indicating whether the stop hook is already active. True if already continuing from a previous stop hook. #### Syntax ```csharp theme={"dark"} public bool StopHookActive { get; set; } ``` #### Property Value Type: `bool` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SubagentStopHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SubagentStopHookInput Represents the input received by a SubagentStop hook. This hook runs when subagent tasks complete. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.SubagentStopHookInput ``` ## Summary Represents the input received by a SubagentStop hook. This hook runs when subagent tasks complete. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SubagentStopHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### StopHookActive Gets or sets a value indicating whether the stop hook is already active. True if already continuing from a previous stop hook. #### Syntax ```csharp theme={"dark"} public bool StopHookActive { get; set; } ``` #### Property Value Type: `bool` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ToolHookInputBase Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/ToolHookInputBase Base class for tool-related hook inputs that contain tool name, input, and use ID. Used as a base for PreToolUse and PostToolUse hook inputs. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase ``` ## Summary Base class for tool-related hook inputs that contain tool name, input, and use ID. Used as a base for PreToolUse and PostToolUse hook inputs. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public TToolInput ToolInput { get; set; } ``` #### Property Value Type: `TToolInput?` ### ToolName Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # UserPromptSubmitHookInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/UserPromptSubmitHookInput Represents the input received by a UserPromptSubmit hook. This hook runs when the user submits a prompt, before Claude processes it. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Inputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Inputs.UserPromptSubmitHookInput ``` ## Summary Represents the input received by a UserPromptSubmit hook. This hook runs when the user submits a prompt, before Claude processes it. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public UserPromptSubmitHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### Prompt Gets or sets the text of the user's submitted prompt. #### Syntax ```csharp theme={"dark"} public string Prompt { get; set; } ``` #### Property Value Type: `string` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/index Summary of the CloudNimble.ClaudeEssentials.Hooks.Inputs Namespace ## Summary The `Inputs` namespace contains classes for deserializing JSON data that Claude Code sends to hooks via stdin. Each hook event type has a corresponding input class. ## Input Classes | Class | Hook Event | Description | | - | - | - | | `PreToolUseHookInput` | PreToolUse | Received before a tool executes | | `PostToolUseHookInput` | PostToolUse | Received after a tool completes | | `PermissionRequestHookInput` | PermissionRequest | Received when permission is requested | | `UserPromptSubmitHookInput` | UserPromptSubmit | Received when user submits a prompt | | `StopHookInput` | Stop | Received when Claude finishes responding | | `SubagentStopHookInput` | SubagentStop | Received when a subagent completes | | `NotificationHookInput` | Notification | Received for notifications | | `SessionStartHookInput` | SessionStart | Received when a session starts | | `SessionEndHookInput` | SessionEnd | Received when a session ends | | `PreCompactHookInput` | PreCompact | Received before context compaction | All input classes inherit from `HookInputBase` which provides common properties like `SessionId`, `TranscriptPath`, and `CurrentWorkingDirectory`. ## Usage ### Deserializing Hook Input Use `ClaudeHooksSerializer` to deserialize input from stdin: ```csharp theme={"dark"} // For PreToolUse hooks var input = ClaudeHooksSerializer.DeserializePreToolUseInput(Console.In.ReadToEnd()); Console.WriteLine($"Tool: {input?.ToolName}"); Console.WriteLine($"Session: {input?.SessionId}"); // For strongly-typed tool input (requires custom JsonSerializerContext) var typedInput = ClaudeHooksSerializer.DeserializePreToolUseInput( json, MyJsonContext.Default.PreToolUseHookInputMyToolInput); ``` ### Common Base Properties All inputs include these properties from `HookInputBase`: * `SessionId` - Unique session identifier * `TranscriptPath` - Path to conversation transcript * `CurrentWorkingDirectory` - Active working directory * `PermissionMode` - Current permission mode * `HookEventName` - The event that triggered this hook ## Types ### Classes | Name | Summary | | - | - | | [HookInputBase](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/HookInputBase) | Base class containing common fields present in all hook inputs. All hooks receive these fields via JSON through stdin. | | [ToolHookInputBase](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/ToolHookInputBase) | Base class for tool-related hook inputs that contain tool name, input, and use ID. Used as a base for PreToolUse and PostToolUse hook inputs. | | [NotificationHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/NotificationHookInput) | Represents the input received by a Notification hook. This hook runs when Claude Code sends notifications. | | [PermissionRequestHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PermissionRequestHookInput) | Represents the input received by a PermissionRequest hook. This hook runs when a permission dialog is shown and can automatically allow or deny permissions. | | [PostToolUseHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PostToolUseHookInput) | Represents the input received by a PostToolUse hook. This hook runs after tool calls complete and includes the tool's response. | | [PreCompactHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PreCompactHookInput) | Represents the input received by a PreCompact hook. This hook runs before a compact operation. | | [PreToolUseHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/PreToolUseHookInput) | Represents the input received by a PreToolUse hook. This hook runs before tool calls are executed and can block or modify them. | | [SessionEndHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SessionEndHookInput) | Represents the input received by a SessionEnd hook. This hook runs when a Claude Code session ends. | | [SessionStartHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SessionStartHookInput) | Represents the input received by a SessionStart hook. This hook runs when Claude Code starts a new session or resumes one. | | [StopHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/StopHookInput) | Represents the input received by a Stop hook. This hook runs when Claude Code finishes responding. | | [SubagentStopHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/SubagentStopHookInput) | Represents the input received by a SubagentStop hook. This hook runs when subagent tasks complete. | | [UserPromptSubmitHookInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Inputs/UserPromptSubmitHookInput) | Represents the input received by a UserPromptSubmit hook. This hook runs when the user submits a prompt, before Claude processes it. | # NotificationType Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/NotificationType Represents the type of notification sent by Claude Code. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.NotificationType ``` ## Summary Represents the type of notification sent by Claude Code. ## Values | Name | Value | Description | | - | - | - | | `PermissionPrompt` | 0 | A permission prompt notification requiring user action. | | `IdlePrompt` | 1 | An idle prompt notification indicating Claude is waiting for input. | | `AuthSuccess` | 2 | A notification indicating successful authentication. | | `ElicitationDialog` | 3 | An elicitation dialog notification for gathering user input. | # HookOutputBase Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase Base class containing common fields for all hook outputs. Hook outputs are written to stdout as JSON when the hook exits with code 0. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ``` ## Summary Base class containing common fields for all hook outputs. Hook outputs are written to stdout as JSON when the hook exits with code 0. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### StopReason Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # HookSpecificOutputBase Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookSpecificOutputBase Base class for hook-specific output data. Contains the hook event name and serves as base for specific output types. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase ``` ## Summary Base class for hook-specific output data. Contains the hook event name and serves as base for specific output types. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### HookEventName Abstract Gets or sets the name of the hook event this output corresponds to. #### Syntax ```csharp theme={"dark"} public abstract CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NotificationHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/NotificationHookOutput Represents the output for a Notification hook. The Notification hook typically only uses base output fields. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.NotificationHookOutput ``` ## Summary Represents the output for a Notification hook. The Notification hook typically only uses base output fields. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NotificationHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PermissionRequestDecision Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PermissionRequestDecision Represents the decision object for a PermissionRequest hook response. Contains the behavior decision and optional parameters. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestDecision ``` ## Summary Represents the decision object for a PermissionRequest hook response. Contains the behavior decision and optional parameters. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters for updates. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PermissionRequestDecision() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Behavior Gets or sets the behavior to take for the permission request. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionRequestBehavior Behavior { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionRequestBehavior?` ### Interrupt Gets or sets a value indicating whether to interrupt the current operation. Only applicable when `Behavior` is [PermissionRequestBehavior.Deny](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionRequestBehavior#deny). #### Syntax ```csharp theme={"dark"} public bool Interrupt { get; set; } ``` #### Property Value Type: `bool` ### Message Gets or sets the message to display when the permission is denied. Only applicable when `Behavior` is [PermissionRequestBehavior.Deny](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionRequestBehavior#deny). #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string?` ### UpdatedInput Gets or sets optional modifications to the tool's input parameters. Only applicable when `Behavior` is [PermissionRequestBehavior.Allow](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionRequestBehavior#allow). #### Syntax ```csharp theme={"dark"} public TToolInput UpdatedInput { get; set; } ``` #### Property Value Type: `TToolInput?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PermissionRequestHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PermissionRequestHookOutput Represents the complete output for a PermissionRequest hook. Combines base output fields with PermissionRequest-specific output. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestHookOutput ``` ## Summary Represents the complete output for a PermissionRequest hook. Combines base output fields with PermissionRequest-specific output. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters for updates. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PermissionRequestHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### HookSpecificOutput Gets or sets the hook-specific output containing the permission decision. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestSpecificOutput HookSpecificOutput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestSpecificOutput?` ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PermissionRequestSpecificOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PermissionRequestSpecificOutput Represents the hook-specific output for a PermissionRequest hook. Contains the decision object with behavior and optional parameters. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestSpecificOutput ``` ## Summary Represents the hook-specific output for a PermissionRequest hook. Contains the decision object with behavior and optional parameters. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters for updates. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PermissionRequestSpecificOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` #### Syntax ```csharp theme={"dark"} protected HookSpecificOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Decision Gets or sets the decision object containing the behavior and related options. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestDecision Decision { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestDecision?` ### HookEventName Override Gets the hook event name for this output type. #### Syntax ```csharp theme={"dark"} public override CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### HookEventName Inherited Abstract Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` Gets or sets the name of the hook event this output corresponds to. #### Syntax ```csharp theme={"dark"} public abstract CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PostToolUseHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PostToolUseHookOutput Represents the complete output for a PostToolUse hook. Combines base output fields with PostToolUse-specific output. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseHookOutput ``` ## Summary Represents the complete output for a PostToolUse hook. Combines base output fields with PostToolUse-specific output. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PostToolUseHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### Decision Gets or sets the decision for the post-tool-use operation. Set to [HookDecision.Block](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookDecision#block) to block further processing. #### Syntax ```csharp theme={"dark"} public System.Nullable Decision { get; set; } ``` #### Property Value Type: `System.Nullable?` ### HookSpecificOutput Gets or sets the hook-specific output containing additional context. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseSpecificOutput HookSpecificOutput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseSpecificOutput?` ### Reason Gets or sets the reason for the decision. Required when [PostToolUseHookOutput.Decision](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PostToolUseHookOutput#decision) is set to explain the rationale. #### Syntax ```csharp theme={"dark"} public string Reason { get; set; } ``` #### Property Value Type: `string?` ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PostToolUseSpecificOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PostToolUseSpecificOutput Represents the hook-specific output for a PostToolUse hook. Contains additional context to provide to Claude after tool execution. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseSpecificOutput ``` ## Summary Represents the hook-specific output for a PostToolUse hook. Contains additional context to provide to Claude after tool execution. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PostToolUseSpecificOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` #### Syntax ```csharp theme={"dark"} protected HookSpecificOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdditionalContext Gets or sets additional context information to provide to Claude. This information is added to Claude's context about the tool execution. #### Syntax ```csharp theme={"dark"} public string AdditionalContext { get; set; } ``` #### Property Value Type: `string?` ### HookEventName Override Gets the hook event name for this output type. #### Syntax ```csharp theme={"dark"} public override CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName?` ### HookEventName Inherited Abstract Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` Gets or sets the name of the hook event this output corresponds to. #### Syntax ```csharp theme={"dark"} public abstract CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PreCompactHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PreCompactHookOutput Represents the output for a PreCompact hook. The PreCompact hook typically only uses base output fields. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PreCompactHookOutput ``` ## Summary Represents the output for a PreCompact hook. The PreCompact hook typically only uses base output fields. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PreCompactHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PreToolUseHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PreToolUseHookOutput Represents the complete output for a PreToolUse hook. Combines base output fields with PreToolUse-specific output. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput ``` ## Summary Represents the complete output for a PreToolUse hook. Combines base output fields with PreToolUse-specific output. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters for updates. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PreToolUseHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### HookSpecificOutput Gets or sets the hook-specific output containing permission decisions and input modifications. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseSpecificOutput HookSpecificOutput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseSpecificOutput?` ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PreToolUseSpecificOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PreToolUseSpecificOutput Represents the hook-specific output for a PreToolUse hook. Contains permission decisions and optional input modifications. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseSpecificOutput ``` ## Summary Represents the hook-specific output for a PreToolUse hook. Contains permission decisions and optional input modifications. ## Type Parameters * `TToolInput` - The type representing the tool's input parameters for updates. Use a specific tool input class or [Object](https://learn.microsoft.com/dotnet/api/system.object) for dynamic inputs. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public PreToolUseSpecificOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` #### Syntax ```csharp theme={"dark"} protected HookSpecificOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### HookEventName Override Gets the hook event name for this output type. #### Syntax ```csharp theme={"dark"} public override CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName?` ### HookEventName Inherited Abstract Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` Gets or sets the name of the hook event this output corresponds to. #### Syntax ```csharp theme={"dark"} public abstract CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionDecision Gets or sets the permission decision for the tool execution. #### Syntax ```csharp theme={"dark"} public System.Nullable PermissionDecision { get; set; } ``` #### Property Value Type: `System.Nullable?` ### PermissionDecisionReason Gets or sets the reason for the permission decision. This message is shown to Claude to explain why the tool was allowed, denied, or requires user input. #### Syntax ```csharp theme={"dark"} public string PermissionDecisionReason { get; set; } ``` #### Property Value Type: `string?` ### UpdatedInput Gets or sets optional modifications to the tool's input parameters. Only the fields that need to be changed should be included. #### Syntax ```csharp theme={"dark"} public TToolInput UpdatedInput { get; set; } ``` #### Property Value Type: `TToolInput?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SessionEndHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionEndHookOutput Represents the output for a SessionEnd hook. The SessionEnd hook typically only uses base output fields. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionEndHookOutput ``` ## Summary Represents the output for a SessionEnd hook. The SessionEnd hook typically only uses base output fields. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SessionEndHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SessionStartHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionStartHookOutput Represents the complete output for a SessionStart hook. Combines base output fields with SessionStart-specific output. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartHookOutput ``` ## Summary Represents the complete output for a SessionStart hook. Combines base output fields with SessionStart-specific output. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SessionStartHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### HookSpecificOutput Gets or sets the hook-specific output containing additional context. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartSpecificOutput HookSpecificOutput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartSpecificOutput?` ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SessionStartSpecificOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionStartSpecificOutput Represents the hook-specific output for a SessionStart hook. Contains additional context to add to the session start. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartSpecificOutput ``` ## Summary Represents the hook-specific output for a SessionStart hook. Contains additional context to add to the session start. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SessionStartSpecificOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` #### Syntax ```csharp theme={"dark"} protected HookSpecificOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdditionalContext Gets or sets additional context information to add to the session start. This context is available to Claude at the beginning of the session. #### Syntax ```csharp theme={"dark"} public string AdditionalContext { get; set; } ``` #### Property Value Type: `string?` ### HookEventName Override Gets the hook event name for this output type. #### Syntax ```csharp theme={"dark"} public override CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName?` ### HookEventName Inherited Abstract Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` Gets or sets the name of the hook event this output corresponds to. #### Syntax ```csharp theme={"dark"} public abstract CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # StopHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/StopHookOutput Represents the output for a Stop hook. Used to optionally block Claude from stopping and continue processing. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.StopHookOutput ``` ## Summary Represents the output for a Stop hook. Used to optionally block Claude from stopping and continue processing. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public StopHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### Decision Gets or sets the decision for the stop operation. Set to [HookDecision.Block](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookDecision#block) to prevent Claude from stopping. #### Syntax ```csharp theme={"dark"} public System.Nullable Decision { get; set; } ``` #### Property Value Type: `System.Nullable?` ### Reason Gets or sets the reason for blocking the stop operation. Required when blocking to explain why Claude should continue. #### Syntax ```csharp theme={"dark"} public string Reason { get; set; } ``` #### Property Value Type: `string?` ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SubagentStopHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SubagentStopHookOutput Represents the output for a SubagentStop hook. Used to optionally block a subagent from stopping and continue processing. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.SubagentStopHookOutput ``` ## Summary Represents the output for a SubagentStop hook. Used to optionally block a subagent from stopping and continue processing. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SubagentStopHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### Decision Gets or sets the decision for the subagent stop operation. Set to [HookDecision.Block](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookDecision#block) to prevent the subagent from stopping. #### Syntax ```csharp theme={"dark"} public System.Nullable Decision { get; set; } ``` #### Property Value Type: `System.Nullable?` ### Reason Gets or sets the reason for blocking the stop operation. Required when blocking to explain why the subagent should continue. #### Syntax ```csharp theme={"dark"} public string Reason { get; set; } ``` #### Property Value Type: `string?` ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # UserPromptSubmitHookOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/UserPromptSubmitHookOutput Represents the complete output for a UserPromptSubmit hook. Combines base output fields with UserPromptSubmit-specific output. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitHookOutput ``` ## Summary Represents the complete output for a UserPromptSubmit hook. Combines base output fields with UserPromptSubmit-specific output. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public UserPromptSubmitHookOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` #### Syntax ```csharp theme={"dark"} protected HookOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Continue Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to continue with the operation. When set to false, the operation will be stopped. Defaults to true. #### Syntax ```csharp theme={"dark"} public bool Continue { get; set; } ``` #### Property Value Type: `bool` #### Remarks This property is always serialized to ensure explicit intent is communicated. ### Decision Gets or sets the decision for the user prompt submission. Set to [HookDecision.Block](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookDecision#block) to block the prompt from being processed. #### Syntax ```csharp theme={"dark"} public System.Nullable Decision { get; set; } ``` #### Property Value Type: `System.Nullable?` ### HookSpecificOutput Gets or sets the hook-specific output containing additional context. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitSpecificOutput HookSpecificOutput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitSpecificOutput?` ### Reason Gets or sets the reason for blocking the prompt. Only shown to the user when the prompt is blocked. #### Syntax ```csharp theme={"dark"} public string Reason { get; set; } ``` #### Property Value Type: `string?` ### StopReason Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets the reason message shown when [HookOutputBase.Continue](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase#continue) is false. This message is displayed to the user when the operation is stopped. #### Syntax ```csharp theme={"dark"} public string StopReason { get; set; } ``` #### Property Value Type: `string?` ### SuppressOutput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets a value indicating whether to suppress output from the transcript. When true, the hook's output will not appear in the conversation transcript. Defaults to false. #### Syntax ```csharp theme={"dark"} public bool SuppressOutput { get; set; } ``` #### Property Value Type: `bool` ### SystemMessage Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookOutputBase` Gets or sets an optional warning message to include in the system context. This message is shown to Claude as additional context. #### Syntax ```csharp theme={"dark"} public string SystemMessage { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # UserPromptSubmitSpecificOutput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/UserPromptSubmitSpecificOutput Represents the hook-specific output for a UserPromptSubmit hook. Contains additional context to add to Claude's processing of the user prompt. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Outputs **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitSpecificOutput ``` ## Summary Represents the hook-specific output for a UserPromptSubmit hook. Contains additional context to add to Claude's processing of the user prompt. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public UserPromptSubmitSpecificOutput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` #### Syntax ```csharp theme={"dark"} protected HookSpecificOutputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdditionalContext Gets or sets additional context information to provide to Claude. This information is added to Claude's context when processing the user's prompt. #### Syntax ```csharp theme={"dark"} public string AdditionalContext { get; set; } ``` #### Property Value Type: `string?` ### HookEventName Override Gets the hook event name for this output type. #### Syntax ```csharp theme={"dark"} public override CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName?` ### HookEventName Inherited Abstract Inherited from `CloudNimble.ClaudeEssentials.Hooks.Outputs.HookSpecificOutputBase` Gets or sets the name of the hook event this output corresponds to. #### Syntax ```csharp theme={"dark"} public abstract CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/index Summary of the CloudNimble.ClaudeEssentials.Hooks.Outputs Namespace ## Summary The `Outputs` namespace contains classes for serializing JSON responses that hooks send to Claude Code via stdout. All output classes inherit from `HookOutputBase` which provides `Continue`, `StopReason`, `SuppressOutput`, and `SystemMessage` properties. ## Usage ### Creating and Serializing Output ```csharp theme={"dark"} // Simple output - allow operation to continue var output = new PreToolUseHookOutput { Continue = true }; Console.WriteLine(ClaudeHooksSerializer.SerializePreToolUseOutput(output)); // Block an operation var blockOutput = new StopHookOutput { Decision = HookDecision.Block, Reason = "Tests must pass before stopping" }; Console.WriteLine(ClaudeHooksSerializer.SerializeStopOutput(blockOutput)); ``` ### Exit Codes * **0**: Success - stdout is parsed as JSON * **2**: Blocking error - stderr is shown to Claude/user * **Other**: Non-blocking error - shown in verbose mode only ### Common Base Properties All outputs inherit from `HookOutputBase`: * `Continue` - Whether to continue (default: true) * `StopReason` - Message when Continue is false * `SuppressOutput` - Hide from transcript * `SystemMessage` - Warning message for Claude ## Types ### Classes | Name | Summary | | - | - | | [HookOutputBase](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookOutputBase) | Base class containing common fields for all hook outputs. Hook outputs are written to stdout as JSON when the hook exits with code 0. | | [HookSpecificOutputBase](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/HookSpecificOutputBase) | Base class for hook-specific output data. Contains the hook event name and serves as base for specific output types. | | [NotificationHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/NotificationHookOutput) | Represents the output for a Notification hook. The Notification hook typically only uses base output fields. | | [PermissionRequestDecision](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PermissionRequestDecision) | Represents the decision object for a PermissionRequest hook response. Contains the behavior decision and optional parameters. | | [PermissionRequestHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PermissionRequestHookOutput) | Represents the complete output for a PermissionRequest hook. Combines base output fields with PermissionRequest-specific output. | | [PermissionRequestSpecificOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PermissionRequestSpecificOutput) | Represents the hook-specific output for a PermissionRequest hook. Contains the decision object with behavior and optional parameters. | | [PostToolUseHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PostToolUseHookOutput) | Represents the complete output for a PostToolUse hook. Combines base output fields with PostToolUse-specific output. | | [PostToolUseSpecificOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PostToolUseSpecificOutput) | Represents the hook-specific output for a PostToolUse hook. Contains additional context to provide to Claude after tool execution. | | [PreCompactHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PreCompactHookOutput) | Represents the output for a PreCompact hook. The PreCompact hook typically only uses base output fields. | | [PreToolUseHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PreToolUseHookOutput) | Represents the complete output for a PreToolUse hook. Combines base output fields with PreToolUse-specific output. | | [PreToolUseSpecificOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/PreToolUseSpecificOutput) | Represents the hook-specific output for a PreToolUse hook. Contains permission decisions and optional input modifications. | | [SessionEndHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionEndHookOutput) | Represents the output for a SessionEnd hook. The SessionEnd hook typically only uses base output fields. | | [SessionStartHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionStartHookOutput) | Represents the complete output for a SessionStart hook. Combines base output fields with SessionStart-specific output. | | [SessionStartSpecificOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SessionStartSpecificOutput) | Represents the hook-specific output for a SessionStart hook. Contains additional context to add to the session start. | | [StopHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/StopHookOutput) | Represents the output for a Stop hook. Used to optionally block Claude from stopping and continue processing. | | [SubagentStopHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/SubagentStopHookOutput) | Represents the output for a SubagentStop hook. Used to optionally block a subagent from stopping and continue processing. | | [UserPromptSubmitHookOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/UserPromptSubmitHookOutput) | Represents the complete output for a UserPromptSubmit hook. Combines base output fields with UserPromptSubmit-specific output. | | [UserPromptSubmitSpecificOutput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Outputs/UserPromptSubmitSpecificOutput) | Represents the hook-specific output for a UserPromptSubmit hook. Contains additional context to add to Claude's processing of the user prompt. | # PermissionDecision Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionDecision Represents the decision for a PreToolUse permission check. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.PermissionDecision ``` ## Summary Represents the decision for a PreToolUse permission check. ## Values | Name | Value | Description | | - | - | - | | `Allow` | 0 | Allow the tool to execute without prompting the user. | | `Deny` | 1 | Deny the tool execution and inform Claude of the denial. | | `Ask` | 2 | Prompt the user to decide whether to allow the tool execution. | # PermissionMode Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionMode Represents the permission mode under which Claude Code is operating. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.PermissionMode ``` ## Summary Represents the permission mode under which Claude Code is operating. ## Values | Name | Value | Description | | - | - | - | | `Default` | 0 | Default permission mode requiring explicit user approval for sensitive operations. | | `Plan` | 1 | Plan mode where Claude explores and plans but doesn't execute changes. | | `AcceptEdits` | 2 | Mode that automatically accepts file edits without prompting. | | `BypassPermissions` | 3 | Mode that bypasses all permission prompts. Use with caution. | # PermissionRequestBehavior Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionRequestBehavior Represents the behavior decision for a PermissionRequest hook. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.PermissionRequestBehavior ``` ## Summary Represents the behavior decision for a PermissionRequest hook. ## Values | Name | Value | Description | | - | - | - | | `Allow` | 0 | Allow the permission request and proceed with the operation. | | `Deny` | 1 | Deny the permission request and block the operation. | # SessionEndReason Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/SessionEndReason Represents the reason why a session ended. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.SessionEndReason ``` ## Summary Represents the reason why a session ended. ## Values | Name | Value | Description | | - | - | - | | `Clear` | 0 | Session ended due to a clear command. | | `Logout` | 1 | Session ended due to user logout. | | `PromptInputExit` | 2 | Session ended due to user exiting from prompt input. | | `Other` | 3 | Session ended for another unspecified reason. | # SessionStartSource Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/SessionStartSource Represents the source that triggered a session start event. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.SessionStartSource ``` ## Summary Represents the source that triggered a session start event. ## Values | Name | Value | Description | | - | - | - | | `Startup` | 0 | Session started from initial startup of Claude Code. | | `Resume` | 1 | Session resumed from a previous session. | | `Clear` | 2 | Session started after a clear command. | | `Compact` | 3 | Session started after a compact operation. | # BashPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/BashPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the Bash tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.BashPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the Bash tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the Bash tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "Bash". The Bash tool executes shell commands. Your hook receives both the command that was run and its stdout/stderr output, enabling logging, output filtering, or error detection. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<BashPostToolUsePayload>(json); if (payload.ToolResponse.Interrupted) Console.WriteLine($"Command timed out: {payload.ToolInput.Command}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BashPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.BashToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.BashToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.BashToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.BashToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # BashPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/BashPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the Bash tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.BashPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the Bash tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the Bash tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Bash". The Bash tool executes shell commands. Your hook can inspect the command before execution, enabling security checks, command filtering, or logging of potentially dangerous operations. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<BashPreToolUsePayload>(json); Console.WriteLine($"Executing command: {payload.ToolInput.Command}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BashPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.BashToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.BashToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EditPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/EditPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the Edit tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.EditPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the Edit tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the Edit tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "Edit". The Edit tool performs string replacements in files. Your hook receives both the replacement parameters and a structured patch showing exactly what changed in the file. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<EditPostToolUsePayload>(json); Console.WriteLine($"Edited {payload.ToolResponse.FilePath}, {payload.ToolResponse.StructuredPatch.Count} hunks changed"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EditPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.EditToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.EditToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.EditToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.EditToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EditPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/EditPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the Edit tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.EditPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the Edit tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the Edit tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Edit". The Edit tool performs string replacements in files. Your hook can inspect the target file, the string being replaced, and the replacement before the edit occurs. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<EditPreToolUsePayload>(json); Console.WriteLine($"Editing {payload.ToolInput.FilePath}: replacing '{payload.ToolInput.OldString}'"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EditPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.EditToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.EditToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # GlobPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GlobPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the Glob tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.GlobPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the Glob tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the Glob tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "Glob". The Glob tool searches for files matching a pattern. Your hook receives both the search parameters and the list of matching files, enabling file access logging or result filtering. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<GlobPostToolUsePayload>(json); Console.WriteLine($"Found {payload.ToolResponse.NumFiles} files matching '{payload.ToolInput.Pattern}'"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public GlobPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GlobToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GlobToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GlobToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GlobToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # GlobPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GlobPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the Glob tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.GlobPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the Glob tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the Glob tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Glob". The Glob tool searches for files matching a pattern. Your hook can inspect the pattern and search path before the search occurs, enabling directory access controls. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<GlobPreToolUsePayload>(json); Console.WriteLine($"Searching for pattern: {payload.ToolInput.Pattern}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public GlobPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GlobToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GlobToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # GrepPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GrepPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the Grep tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.GrepPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the Grep tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the Grep tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "Grep". The Grep tool searches file contents using regex patterns. Your hook receives both the search parameters and the results (files, content, or counts depending on mode). \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<GrepPostToolUsePayload>(json); Console.WriteLine($"Found matches in {payload.ToolResponse.NumFiles} files for '{payload.ToolInput.Pattern}'"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public GrepPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GrepToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GrepToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GrepToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GrepToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # GrepPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GrepPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the Grep tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.GrepPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the Grep tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the Grep tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Grep". The Grep tool searches file contents using regex patterns. Your hook can inspect the search pattern and target path before the search occurs, enabling content access controls. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<GrepPreToolUsePayload>(json); Console.WriteLine($"Searching for pattern: {payload.ToolInput.Pattern}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public GrepPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GrepToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GrepToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # BashToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/BashToolInput Represents the input parameters for the Bash tool. The Bash tool executes shell commands in a persistent bash session. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.BashToolInput ``` ## Summary Represents the input parameters for the Bash tool. The Bash tool executes shell commands in a persistent bash session. ## Remarks This tool is for terminal operations like git, npm, docker, etc. If the output exceeds 30000 characters, it will be truncated. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BashToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Command Gets or sets the command to execute. #### Syntax ```csharp theme={"dark"} public string Command { get; set; } ``` #### Property Value Type: `string` ### DangerouslyDisableSandbox Gets or sets whether to dangerously override sandbox mode and run commands without sandboxing. #### Syntax ```csharp theme={"dark"} public System.Nullable DangerouslyDisableSandbox { get; set; } ``` #### Property Value Type: `System.Nullable` ### Description Gets or sets a clear, concise description of what this command does in 5-10 words. #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string?` #### Remarks Should be in active voice. For example: "List files in current directory" or "Install package dependencies". ### RunInBackground Gets or sets whether to run this command in the background. #### Syntax ```csharp theme={"dark"} public System.Nullable RunInBackground { get; set; } ``` #### Property Value Type: `System.Nullable` #### Remarks When `true`, you can monitor the output using subsequent Bash tool calls. You do not need to use '&' at the end of the command when using this parameter. ### Timeout Gets or sets the optional timeout in milliseconds. #### Syntax ```csharp theme={"dark"} public System.Nullable Timeout { get; set; } ``` #### Property Value Type: `System.Nullable` #### Remarks Maximum is 600000 (10 minutes). Default is 120000 (2 minutes). ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EditToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput Represents the input parameters for the Edit tool. The Edit tool performs exact string replacements in files. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.EditToolInput ``` ## Summary Represents the input parameters for the Edit tool. The Edit tool performs exact string replacements in files. ## Remarks The edit will fail if [EditToolInput.OldString](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#oldstring) is not unique in the file, unless [EditToolInput.ReplaceAll](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#replaceall) is set to `true`. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EditToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### FilePath Gets or sets the absolute path to the file to modify. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string` ### NewString Gets or sets the text to replace it with. #### Syntax ```csharp theme={"dark"} public string NewString { get; set; } ``` #### Property Value Type: `string` #### Remarks Must be different from [EditToolInput.OldString](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#oldstring). ### OldString Gets or sets the exact text to replace. #### Syntax ```csharp theme={"dark"} public string OldString { get; set; } ``` #### Property Value Type: `string` ### ReplaceAll Gets or sets whether to replace all occurrences of [EditToolInput.OldString](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#oldstring). #### Syntax ```csharp theme={"dark"} public System.Nullable ReplaceAll { get; set; } ``` #### Property Value Type: `System.Nullable` #### Remarks Default is `false`. Set to `true` to replace all occurrences, useful for renaming variables across a file. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # GlobToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GlobToolInput Represents the input parameters for the Glob tool. The Glob tool provides fast file pattern matching that works with any codebase size. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GlobToolInput ``` ## Summary Represents the input parameters for the Glob tool. The Glob tool provides fast file pattern matching that works with any codebase size. ## Remarks Supports glob patterns like "**/\*.js" or "src/**/\*.ts". Returns matching file paths sorted by modification time. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public GlobToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Path Gets or sets the directory to search in. #### Syntax ```csharp theme={"dark"} public string Path { get; set; } ``` #### Property Value Type: `string?` #### Remarks If not specified, the current working directory will be used. Must be a valid directory path if provided. ### Pattern Gets or sets the glob pattern to match files against. #### Syntax ```csharp theme={"dark"} public string Pattern { get; set; } ``` #### Property Value Type: `string` #### Remarks Examples: "**/\*.js", "src/**/*.ts", "*.md" ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # GrepToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GrepToolInput Represents the input parameters for the Grep tool. The Grep tool is a powerful content search built on ripgrep. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.GrepToolInput ``` ## Summary Represents the input parameters for the Grep tool. The Grep tool is a powerful content search built on ripgrep. ## Remarks Supports full regex syntax (e.g., "log.\*Error", "function\s+\w+"). Filter files with glob parameter or type parameter. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public GrepToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CaseInsensitive Gets or sets whether to perform case insensitive search. #### Syntax ```csharp theme={"dark"} public System.Nullable CaseInsensitive { get; set; } ``` #### Property Value Type: `System.Nullable?` ### Glob Gets or sets the glob pattern to filter files. #### Syntax ```csharp theme={"dark"} public string Glob { get; set; } ``` #### Property Value Type: `string?` #### Remarks Examples: "*.js", "*." ### HeadLimit Gets or sets the limit on output to first N lines/entries. #### Syntax ```csharp theme={"dark"} public System.Nullable HeadLimit { get; set; } ``` #### Property Value Type: `System.Nullable?` #### Remarks Equivalent to "| head -N". Defaults to 0 (unlimited). ### LinesAfter Gets or sets the number of lines to show after each match. #### Syntax ```csharp theme={"dark"} public System.Nullable LinesAfter { get; set; } ``` #### Property Value Type: `System.Nullable?` #### Remarks Requires output\_mode: "content", ignored otherwise. ### LinesBefore Gets or sets the number of lines to show before each match. #### Syntax ```csharp theme={"dark"} public System.Nullable LinesBefore { get; set; } ``` #### Property Value Type: `System.Nullable?` #### Remarks Requires output\_mode: "content", ignored otherwise. ### LinesContext Gets or sets the number of lines to show before and after each match. #### Syntax ```csharp theme={"dark"} public System.Nullable LinesContext { get; set; } ``` #### Property Value Type: `System.Nullable?` #### Remarks Requires output\_mode: "content", ignored otherwise. ### Multiline Gets or sets whether to enable multiline mode. #### Syntax ```csharp theme={"dark"} public System.Nullable Multiline { get; set; } ``` #### Property Value Type: `System.Nullable?` #### Remarks When enabled, '.' matches newlines and patterns can span lines. Default: false. ### Offset Gets or sets the number of lines/entries to skip before applying head\_limit. #### Syntax ```csharp theme={"dark"} public System.Nullable Offset { get; set; } ``` #### Property Value Type: `System.Nullable?` #### Remarks Equivalent to "| tail -n +N | head -N". Defaults to 0. ### OutputMode Gets or sets the output mode. #### Syntax ```csharp theme={"dark"} public string OutputMode { get; set; } ``` #### Property Value Type: `string?` #### Remarks Options: "content" (shows matching lines), "files\_with\_matches" (shows only file paths, default), "count" (shows match counts). ### Path Gets or sets the file or directory to search in. #### Syntax ```csharp theme={"dark"} public string Path { get; set; } ``` #### Property Value Type: `string?` #### Remarks Defaults to current working directory if not specified. ### Pattern Gets or sets the regular expression pattern to search for in file contents. #### Syntax ```csharp theme={"dark"} public string Pattern { get; set; } ``` #### Property Value Type: `string` #### Remarks Uses ripgrep syntax. Literal braces need escaping (use "interface\{}" to find "interface" in Go code). ### ShowLineNumbers Gets or sets whether to show line numbers in output. #### Syntax ```csharp theme={"dark"} public System.Nullable ShowLineNumbers { get; set; } ``` #### Property Value Type: `System.Nullable?` #### Remarks Requires output\_mode: "content", ignored otherwise. Defaults to true. ### Type Gets or sets the file type to search. #### Syntax ```csharp theme={"dark"} public string Type { get; set; } ``` #### Property Value Type: `string?` #### Remarks Common types: js, py, rust, go, java, etc. More efficient than glob for standard file types. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # KillShellToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/KillShellToolInput Represents the input parameters for the KillShell tool. The KillShell tool terminates a running background bash shell by its ID. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.KillShellToolInput ``` ## Summary Represents the input parameters for the KillShell tool. The KillShell tool terminates a running background bash shell by its ID. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public KillShellToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ShellId Gets or sets the ID of the background shell to kill. #### Syntax ```csharp theme={"dark"} public string ShellId { get; set; } ``` #### Property Value Type: `string` #### Remarks Shell IDs can be found using the /tasks command. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NotebookEditToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/NotebookEditToolInput Represents the input parameters for the NotebookEdit tool. The NotebookEdit tool replaces the contents of a specific cell in a Jupyter notebook. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.NotebookEditToolInput ``` ## Summary Represents the input parameters for the NotebookEdit tool. The NotebookEdit tool replaces the contents of a specific cell in a Jupyter notebook. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NotebookEditToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CellId Gets or sets the ID of the cell to edit. #### Syntax ```csharp theme={"dark"} public string CellId { get; set; } ``` #### Property Value Type: `string?` #### Remarks When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified. ### CellType Gets or sets the type of the cell. #### Syntax ```csharp theme={"dark"} public string CellType { get; set; } ``` #### Property Value Type: `string?` #### Remarks Options: "code" or "markdown". If not specified, defaults to the current cell type. Required when using edit\_mode=insert. ### EditMode Gets or sets the type of edit to make. #### Syntax ```csharp theme={"dark"} public string EditMode { get; set; } ``` #### Property Value Type: `string?` #### Remarks Options: "replace" (default), "insert", or "delete". ### NewSource Gets or sets the new source for the cell. #### Syntax ```csharp theme={"dark"} public string NewSource { get; set; } ``` #### Property Value Type: `string` ### NotebookPath Gets or sets the absolute path to the Jupyter notebook file to edit. #### Syntax ```csharp theme={"dark"} public string NotebookPath { get; set; } ``` #### Property Value Type: `string` #### Remarks Must be an absolute path, not a relative path. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ReadToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/ReadToolInput Represents the input parameters for the Read tool. The Read tool reads files from the local filesystem. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.ReadToolInput ``` ## Summary Represents the input parameters for the Read tool. The Read tool reads files from the local filesystem. ## Remarks By default, reads up to 2000 lines starting from the beginning of the file. You can optionally specify a line offset and limit for reading specific portions. The Read tool can also read images (PNG, JPG, etc.), PDF files, and Jupyter notebooks (.ipynb). ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ReadToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### FilePath Gets or sets the absolute path to the file to read. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string` #### Remarks Must be an absolute path, not a relative path. ### Limit Gets or sets the number of lines to read. #### Syntax ```csharp theme={"dark"} public System.Nullable Limit { get; set; } ``` #### Property Value Type: `System.Nullable` #### Remarks Optional. Only provide if the file is too large to read at once. ### Offset Gets or sets the line number to start reading from. #### Syntax ```csharp theme={"dark"} public System.Nullable Offset { get; set; } ``` #### Property Value Type: `System.Nullable` #### Remarks Optional. Only provide if the file is too large to read at once. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TaskToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/TaskToolInput Represents the input parameters for the Task tool. The Task tool launches specialized agents (subprocesses) that autonomously handle complex tasks. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TaskToolInput ``` ## Summary Represents the input parameters for the Task tool. The Task tool launches specialized agents (subprocesses) that autonomously handle complex tasks. ## Remarks Each agent type has specific capabilities and tools available to it. Available agent types include: general-purpose, Explore, Plan, and others. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TaskToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Description Gets or sets a short (3-5 word) description of the task. #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string` ### Model Gets or sets the optional model to use for this agent. #### Syntax ```csharp theme={"dark"} public string Model { get; set; } ``` #### Property Value Type: `string?` #### Remarks If not specified, inherits from parent. Options: "sonnet", "opus", "haiku". Prefer haiku for quick, straightforward tasks to minimize cost and latency. ### Prompt Gets or sets the task for the agent to perform. #### Syntax ```csharp theme={"dark"} public string Prompt { get; set; } ``` #### Property Value Type: `string` ### Resume Gets or sets an optional agent ID to resume from. #### Syntax ```csharp theme={"dark"} public string Resume { get; set; } ``` #### Property Value Type: `string?` #### Remarks If provided, the agent will continue from the previous execution transcript. ### RunInBackground Gets or sets whether to run this agent in the background. #### Syntax ```csharp theme={"dark"} public System.Nullable RunInBackground { get; set; } ``` #### Property Value Type: `System.Nullable` #### Remarks When `true`, use TaskOutput to read the output later. ### SubagentType Gets or sets the type of specialized agent to use for this task. #### Syntax ```csharp theme={"dark"} public string SubagentType { get; set; } ``` #### Property Value Type: `string` #### Remarks Examples: "general-purpose", "Explore", "Plan", "statusline-setup" ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TodoItem Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/TodoItem Represents a single todo item in the task list. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoItem ``` ## Summary Represents a single todo item in the task list. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TodoItem() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ActiveForm Gets or sets the present continuous form shown during execution. #### Syntax ```csharp theme={"dark"} public string ActiveForm { get; set; } ``` #### Property Value Type: `string` #### Remarks Example: "Running tests", "Building the project" ### Content Gets or sets the imperative form describing what needs to be done. #### Syntax ```csharp theme={"dark"} public string Content { get; set; } ``` #### Property Value Type: `string` #### Remarks Example: "Run tests", "Build the project" ### Status Gets or sets the status of the todo item. #### Syntax ```csharp theme={"dark"} public string Status { get; set; } ``` #### Property Value Type: `string` #### Remarks Options: "pending", "in\_progress", "completed" ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TodoWriteToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/TodoWriteToolInput Represents the input parameters for the TodoWrite tool. The TodoWrite tool creates and manages a structured task list for the current coding sess... ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoWriteToolInput ``` ## Summary Represents the input parameters for the TodoWrite tool. The TodoWrite tool creates and manages a structured task list for the current coding session. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TodoWriteToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Todos Gets or sets the updated todo list. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoItem[] Todos { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoItem[]` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebFetchToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WebFetchToolInput Represents the input parameters for the WebFetch tool. The WebFetch tool fetches content from a URL and processes it using an AI model. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebFetchToolInput ``` ## Summary Represents the input parameters for the WebFetch tool. The WebFetch tool fetches content from a URL and processes it using an AI model. ## Remarks Fetches URL content, converts HTML to markdown, and processes the content with a prompt using a small, fast model. Includes a self-cleaning 15-minute cache. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebFetchToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Prompt Gets or sets the prompt to run on the fetched content. #### Syntax ```csharp theme={"dark"} public string Prompt { get; set; } ``` #### Property Value Type: `string` #### Remarks Describes what information to extract from the page. ### Url Gets or sets the URL to fetch content from. #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string` #### Remarks Must be a fully-formed valid URL. HTTP URLs will be automatically upgraded to HTTPS. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebSearchToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WebSearchToolInput Represents the input parameters for the WebSearch tool. The WebSearch tool allows Claude to search the web and use the results to inform responses. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebSearchToolInput ``` ## Summary Represents the input parameters for the WebSearch tool. The WebSearch tool allows Claude to search the web and use the results to inform responses. ## Remarks Provides up-to-date information for current events and recent data. Web search is only available in the US. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebSearchToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AllowedDomains Gets or sets the domains to include in search results. #### Syntax ```csharp theme={"dark"} public string[] AllowedDomains { get; set; } ``` #### Property Value Type: `string[]?` #### Remarks Only include search results from these domains. ### BlockedDomains Gets or sets the domains to exclude from search results. #### Syntax ```csharp theme={"dark"} public string[] BlockedDomains { get; set; } ``` #### Property Value Type: `string[]?` #### Remarks Never include search results from these domains. ### Query Gets or sets the search query to use. #### Syntax ```csharp theme={"dark"} public string Query { get; set; } ``` #### Property Value Type: `string` #### Remarks Minimum 2 characters. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WriteToolInput Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WriteToolInput Represents the input parameters for the Write tool. The Write tool writes a file to the local filesystem. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput ``` ## Summary Represents the input parameters for the Write tool. The Write tool writes a file to the local filesystem. ## Remarks This tool will overwrite the existing file if there is one at the provided path. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WriteToolInput() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Content Gets or sets the content to write to the file. #### Syntax ```csharp theme={"dark"} public string Content { get; set; } ``` #### Property Value Type: `string` ### FilePath Gets or sets the absolute path to the file to write. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string` #### Remarks Must be an absolute path, not a relative path. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/index Summary of the CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs Namespace ## Types ### Classes | Name | Summary | | - | - | | [BashToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/BashToolInput) | Represents the input parameters for the Bash tool. The Bash tool executes shell commands in a persistent bash session. | | [EditToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput) | Represents the input parameters for the Edit tool. The Edit tool performs exact string replacements in files. | | [GlobToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GlobToolInput) | Represents the input parameters for the Glob tool. The Glob tool provides fast file pattern matching that works with any codebase size. | | [GrepToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GrepToolInput) | Represents the input parameters for the Grep tool. The Grep tool is a powerful content search built on ripgrep. | | [KillShellToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/KillShellToolInput) | Represents the input parameters for the KillShell tool. The KillShell tool terminates a running background bash shell by its ID. | | [NotebookEditToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/NotebookEditToolInput) | Represents the input parameters for the NotebookEdit tool. The NotebookEdit tool replaces the contents of a specific cell in a Jupyter notebook. | | [ReadToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/ReadToolInput) | Represents the input parameters for the Read tool. The Read tool reads files from the local filesystem. | | [TaskToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/TaskToolInput) | Represents the input parameters for the Task tool. The Task tool launches specialized agents (subprocesses) that autonomously handle complex tasks. | | [TodoWriteToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/TodoWriteToolInput) | Represents the input parameters for the TodoWrite tool. The TodoWrite tool creates and manages a structured task list for the current coding session. | | [TodoItem](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/TodoItem) | Represents a single todo item in the task list. | | [WebFetchToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WebFetchToolInput) | Represents the input parameters for the WebFetch tool. The WebFetch tool fetches content from a URL and processes it using an AI model. | | [WebSearchToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WebSearchToolInput) | Represents the input parameters for the WebSearch tool. The WebSearch tool allows Claude to search the web and use the results to inform responses. | | [WriteToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WriteToolInput) | Represents the input parameters for the Write tool. The Write tool writes a file to the local filesystem. | # KillShellPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/KillShellPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the KillShell tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.KillShellPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the KillShell tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the KillShell tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "KillShell". The KillShell tool terminates background shell processes. Your hook receives both the shell ID that was targeted and whether the termination succeeded. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<KillShellPostToolUsePayload>(json); if (!payload.ToolResponse.Success) Console.WriteLine($"Failed to kill shell: {payload.ToolResponse.Error}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public KillShellPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.KillShellToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.KillShellToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.KillShellToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.KillShellToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # KillShellPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/KillShellPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the KillShell tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.KillShellPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the KillShell tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the KillShell tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "KillShell". The KillShell tool terminates background shell processes. Your hook can inspect which shell is being terminated before the kill occurs. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<KillShellPreToolUsePayload>(json); Console.WriteLine($"Killing shell: {payload.ToolInput.ShellId}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public KillShellPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.KillShellToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.KillShellToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NotebookEditPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/NotebookEditPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the NotebookEdit tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.NotebookEditPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the NotebookEdit tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the NotebookEdit tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "NotebookEdit". The NotebookEdit tool modifies Jupyter notebook cells. Your hook receives both the edit parameters and the result, enabling notebook change tracking. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<NotebookEditPostToolUsePayload>(json); if (payload.ToolResponse.Success) Console.WriteLine($"Successfully edited cell in {payload.ToolResponse.NotebookPath}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NotebookEditPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.NotebookEditToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.NotebookEditToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.NotebookEditToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.NotebookEditToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NotebookEditPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/NotebookEditPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the NotebookEdit tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.NotebookEditPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the NotebookEdit tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the NotebookEdit tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "NotebookEdit". The NotebookEdit tool modifies Jupyter notebook cells. Your hook can inspect the notebook path, cell identifier, and new content before the edit occurs. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<NotebookEditPreToolUsePayload>(json); Console.WriteLine($"Editing notebook: {payload.ToolInput.NotebookPath}, mode: {payload.ToolInput.EditMode}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NotebookEditPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.NotebookEditToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.NotebookEditToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ReadPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/ReadPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the Read tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.ReadPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the Read tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the Read tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "Read". The Read tool reads files from the local filesystem. Your hook receives both the file path that was requested and the content that was read, enabling logging, auditing, or post-processing. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<ReadPostToolUsePayload>(json); Console.WriteLine($"Read {payload.ToolResponse.File?.NumLines} lines from {payload.ToolInput.FilePath}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ReadPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.ReadToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.ReadToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.ReadToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.ReadToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ReadPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/ReadPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the Read tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.ReadPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the Read tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the Read tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Read". The Read tool reads files from the local filesystem. Your hook can inspect the file path and other parameters before the read occurs, potentially blocking or modifying the operation. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<ReadPreToolUsePayload>(json); Console.WriteLine($"Reading file: {payload.ToolInput.FilePath}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ReadPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.ReadToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.ReadToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # BashToolResponse Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse Represents the response payload returned by the Claude Code Bash tool after executing a shell command. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.BashToolResponse ``` ## Summary Represents the response payload returned by the Claude Code Bash tool after executing a shell command. ## Remarks The Bash tool executes shell commands in a persistent shell session. This response is received in the [BashPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/BashPostToolUsePayload) when the `tool_name` is "Bash". Commands have a default timeout of 120 seconds (2 minutes), which can be extended up to 600 seconds (10 minutes) using the [BashToolInput.Timeout](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/BashToolInput#timeout) parameter. If a command exceeds its timeout, it will be interrupted and [BashToolResponse.Interrupted](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse#interrupted) will be `true`. Output exceeding 30,000 characters is automatically truncated by Claude Code. Example JSON payload: ```csharp theme={"dark"} { "stdout": "Hello, World!\r\n", "stderr": "", "interrupted": false, "isImage": false } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BashToolResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Interrupted Gets or sets a value indicating whether the command was interrupted before completion. #### Syntax ```csharp theme={"dark"} public bool Interrupted { get; set; } ``` #### Property Value Type: `bool` #### Remarks When `true`, the command did not complete normally. This typically occurs when: * The command exceeded its timeout (default 120 seconds, max 600 seconds) * The user manually cancelled the operation * The command was killed by the system When a command is interrupted, [BashToolResponse.Stdout](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse#stdout) and [BashToolResponse.Stderr](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse#stderr) will contain whatever output was captured before the interruption occurred. ### IsImage Gets or sets a value indicating whether the output contains image data. #### Syntax ```csharp theme={"dark"} public bool IsImage { get; set; } ``` #### Property Value Type: `bool` #### Remarks When `true`, the command produced image output that Claude can interpret visually. This is used for commands that generate images or graphical output. Claude is a multimodal LLM and can process image data directly. When this is `true`, the [BashToolResponse.Stdout](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse#stdout) may contain base64-encoded image data or be empty while the image is presented to Claude separately. ### Stderr Gets or sets the standard error (stderr) output from the executed command. #### Syntax ```csharp theme={"dark"} public string Stderr { get; set; } ``` #### Property Value Type: `string` #### Remarks This contains all text written to stderr by the command. Many commands write warnings, progress information, or diagnostic messages to stderr even when successful. An empty [BashToolResponse.Stderr](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse#stderr) does not necessarily indicate success, and a non-empty [BashToolResponse.Stderr](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse#stderr) does not necessarily indicate failure. Check the actual content and context to determine the command's success. ### Stdout Gets or sets the standard output (stdout) from the executed command. #### Syntax ```csharp theme={"dark"} public string Stdout { get; set; } ``` #### Property Value Type: `string` #### Remarks This contains all text written to stdout by the command. On Windows, line endings will typically be CRLF (`\r\n`), while on Unix-like systems they will be LF (`\n`). If the output exceeds 30,000 characters, it will be truncated by Claude Code. For commands that produce binary output (like image generation), this may be empty and [BashToolResponse.IsImage](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse#isimage) will be `true`. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EditToolResponse Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse Represents the response payload returned by the Claude Code Edit tool after performing a string replacement in a file. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.EditToolResponse ``` ## Summary Represents the response payload returned by the Claude Code Edit tool after performing a string replacement in a file. ## Remarks The Edit tool performs exact string replacements in files. It requires that the target file has been read at least once in the conversation before editing. This response is received in the [EditPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/EditPostToolUsePayload) when the `tool_name` is "Edit". The Edit tool will fail if the [EditToolInput.OldString](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#oldstring) is not unique in the file, unless [EditToolInput.ReplaceAll](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#replaceall) is set to `true`. Example JSON payload: ```csharp theme={"dark"} { "filePath": "C:\\Projects\\MyApp\\Program.cs", "oldString": "Console.WriteLine(\"Hello\");", "newString": "Console.WriteLine(\"Hello, World!\");", "originalFile": "using System;\n\nclass Program...", "structuredPatch": [ { "oldStart": 5, "oldLines": 1, "newStart": 5, "newLines": 1, "lines": ["-Console.WriteLine(\"Hello\");", "+Console.WriteLine(\"Hello, World!\");"] } ], "userModified": false, "replaceAll": false } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EditToolResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### FilePath Gets or sets the absolute path to the file that was edited. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} "C:\\Users\\Developer\\Projects\\MyApp\\src\\Program.cs" ``` #### Remarks This is always an absolute path, regardless of whether the original request used a relative or absolute path. On Windows, this will use backslash separators. ### NewString Gets or sets the new string that replaced the old string. #### Syntax ```csharp theme={"dark"} public string NewString { get; set; } ``` #### Property Value Type: `string` #### Remarks This is the replacement text that now appears in the file where [EditToolResponse.OldString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#oldstring) was previously located. ### OldString Gets or sets the original string that was searched for and replaced. #### Syntax ```csharp theme={"dark"} public string OldString { get; set; } ``` #### Property Value Type: `string` #### Remarks This is the exact string that was matched in the file. The Edit tool preserves the exact indentation (tabs/spaces) from the original file content. ### OriginalFile Gets or sets the complete original content of the file before the edit was applied. #### Syntax ```csharp theme={"dark"} public string OriginalFile { get; set; } ``` #### Property Value Type: `string` #### Remarks This contains the full file content prior to the replacement, which can be useful for implementing undo functionality, auditing changes, or verifying the context of the edit. ### ReplaceAll Gets or sets a value indicating whether all occurrences of the old string were replaced, or just the first occurrence. #### Syntax ```csharp theme={"dark"} public bool ReplaceAll { get; set; } ``` #### Property Value Type: `bool` #### Remarks When `false` (the default), the Edit tool requires that [EditToolResponse.OldString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#oldstring) appears exactly once in the file, and only that single occurrence is replaced. When `true`, all occurrences of [EditToolResponse.OldString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#oldstring) in the file are replaced with [EditToolResponse.NewString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#newstring). This is useful for renaming variables or updating repeated patterns throughout a file. ### StructuredPatch Gets or sets the structured patch representing the changes made to the file. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List StructuredPatch { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks This contains a unified diff representation showing what changed between the original and edited content. Each [StructuredPatchHunk](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/StructuredPatchHunk) represents a contiguous block of changes. When [EditToolResponse.ReplaceAll](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#replaceall) is `true` and multiple replacements were made, there may be multiple hunks in the patch, one for each replacement location. ### UserModified Gets or sets a value indicating whether the file was modified by the user since it was last read by Claude. #### Syntax ```csharp theme={"dark"} public bool UserModified { get; set; } ``` #### Property Value Type: `bool` #### Remarks If `true`, Claude detected that the file content changed between when it was read and when the edit was applied. This can happen if the user edits the file externally while Claude is working. This flag helps track potential merge conflicts or unexpected changes in the editing workflow. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # GlobToolResponse Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GlobToolResponse Represents the response payload returned by the Claude Code Glob tool after searching for files matching a pattern. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GlobToolResponse ``` ## Summary Represents the response payload returned by the Claude Code Glob tool after searching for files matching a pattern. ## Remarks The Glob tool performs fast file pattern matching across codebases of any size. It supports standard glob patterns like `"**/*.js"` or `"src/**/*.ts"`. This response is received in the [GlobPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GlobPostToolUsePayload) when the `tool_name` is "Glob". Results are sorted by modification time (most recently modified first), making it easy to find recently changed files matching a pattern. Example JSON payload: ```csharp theme={"dark"} { "filenames": [ "C:\\Projects\\MyApp\\src\\Program.cs", "C:\\Projects\\MyApp\\src\\Utilities.cs", "C:\\Projects\\MyApp\\tests\\ProgramTests.cs" ], "durationMs": 150, "numFiles": 3, "truncated": false } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public GlobToolResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DurationMs Gets or sets the duration of the glob operation in milliseconds. #### Syntax ```csharp theme={"dark"} public int DurationMs { get; set; } ``` #### Property Value Type: `int` #### Remarks This indicates how long the file system search took to complete. Large codebases or complex patterns may take longer. The Glob tool is optimized for performance and typically completes quickly even on large codebases. ### Filenames Gets or sets the list of absolute file paths matching the glob pattern. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Filenames { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks All paths are absolute and sorted by modification time, with the most recently modified files appearing first in the list. On Windows, paths will use backslash separators. The paths can be used directly with other tools like [ReadToolInput](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/ReadToolInput) to read the matched files. If [GlobToolResponse.Truncated](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GlobToolResponse#truncated) is `true`, not all matching files are included in this list due to result limits. ### NumFiles Gets or sets the number of files found matching the pattern. #### Syntax ```csharp theme={"dark"} public int NumFiles { get; set; } ``` #### Property Value Type: `int` #### Remarks This is the count of files in [GlobToolResponse.Filenames](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GlobToolResponse#filenames). If [GlobToolResponse.Truncated](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GlobToolResponse#truncated) is `true`, this represents only the number of files returned, not the total number of matches. A value of 0 indicates no files matched the specified pattern in the search directory. ### Truncated Gets or sets a value indicating whether the results were truncated due to exceeding the maximum result limit. #### Syntax ```csharp theme={"dark"} public bool Truncated { get; set; } ``` #### Property Value Type: `bool` #### Remarks When `true`, more files matched the pattern than could be returned. Consider using a more specific pattern to narrow down the results, or use the [GlobToolInput.Path](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GlobToolInput#path) parameter to search a more specific directory. When results are truncated, the returned files are still sorted by modification time, so the most recently modified matches are included. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # KillShellToolResponse Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/KillShellToolResponse Represents the response payload returned by the Claude Code KillShell tool after attempting to terminate a background shell process. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.KillShellToolResponse ``` ## Summary Represents the response payload returned by the Claude Code KillShell tool after attempting to terminate a background shell process. ## Remarks The KillShell tool terminates running background bash shells by their ID. Background shells are created when using the [BashToolInput.RunInBackground](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/BashToolInput#runinbackground) parameter. This response is received in the [KillShellPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/KillShellPostToolUsePayload) when the `tool_name` is "KillShell". Background shells are useful for long-running processes like development servers, file watchers, or build processes that need to run while other work continues. The KillShell tool provides a way to gracefully terminate these processes when they are no longer needed. Shell IDs can be found using the `/tasks` command in Claude Code. Example JSON payload (successful): ```csharp theme={"dark"} { "shellId": "shell_abc123", "success": true } ``` Example JSON payload (failed): ```csharp theme={"dark"} { "shellId": "shell_invalid", "success": false, "error": "Shell not found or already terminated" } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public KillShellToolResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Error Gets or sets the error message if the kill operation failed. #### Syntax ```csharp theme={"dark"} public string Error { get; set; } ``` #### Property Value Type: `string?` #### Examples ```csharp theme={"dark"} "Shell not found or already terminated" ``` #### Remarks This property is populated when [KillShellToolResponse.Success](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/KillShellToolResponse#success) is `false`. Common error scenarios include: * The shell ID does not exist * The shell has already been terminated * The shell process could not be killed due to system restrictions * The shell ID format is invalid When [KillShellToolResponse.Success](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/KillShellToolResponse#success) is `true`, this property will be `null`. ### ShellId Gets or sets the identifier of the shell that was targeted for termination. #### Syntax ```csharp theme={"dark"} public string ShellId { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} "shell_abc123xyz" ``` #### Remarks This is the shell ID that was provided in [KillShellToolInput.ShellId](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/KillShellToolInput#shellid). Shell IDs are assigned when background shells are created and follow the format `"shell_"` followed by a unique identifier. Available shell IDs can be discovered using the `/tasks` command in Claude Code. ### Success Gets or sets a value indicating whether the shell was successfully terminated. #### Syntax ```csharp theme={"dark"} public bool Success { get; set; } ``` #### Property Value Type: `bool` #### Remarks When `true`, the shell process was found and terminated successfully. The shell is no longer running and its resources have been released. When `false`, the termination failed. Check the [KillShellToolResponse.Error](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/KillShellToolResponse#error) property for details about why the operation failed. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ReadToolFileInfo Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo Contains detailed information about a file read by the Claude Code Read tool, including its path, content, and line-related metadata. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.ReadToolFileInfo ``` ## Summary Contains detailed information about a file read by the Claude Code Read tool, including its path, content, and line-related metadata. ## Remarks The content returned by the Read tool includes line numbers in a specific format: spaces followed by the line number, a tab character, and then the actual content. For example: `" 1→using System;"` When using the `offset` and `limit` parameters in [ReadToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/ReadToolInput), the [ReadToolFileInfo.StartLine](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo#startline) and [ReadToolFileInfo.NumLines](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo#numlines) properties will reflect the subset of lines that were actually returned, while [ReadToolFileInfo.TotalLines](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo#totallines) always represents the total number of lines in the entire file. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ReadToolFileInfo() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Content Gets or sets the content of the file, formatted with line numbers. #### Syntax ```csharp theme={"dark"} public string Content { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} " 1→using System;\n 2→using System.Text.Json;\n 3→\n 4→namespace MyApp" ``` #### Remarks The content is formatted using `cat -n` style output, where each line is prefixed with its line number. The format is: spaces for padding, line number, tab character (→), then the actual line content. Lines longer than 2000 characters are automatically truncated by Claude Code. ### FilePath Gets or sets the absolute path to the file that was read. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} "C:\\Users\\Developer\\Projects\\MyApp\\src\\Program.cs" ``` #### Remarks This is always an absolute path, regardless of whether the original request used a relative or absolute path. On Windows, this will use backslash separators. ### NumLines Gets or sets the number of lines included in this response. #### Syntax ```csharp theme={"dark"} public int NumLines { get; set; } ``` #### Property Value Type: `int` #### Remarks This value reflects the actual number of lines returned, which may be less than [ReadToolFileInfo.TotalLines](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo#totallines) if the `offset` and `limit` parameters were used in the original [ReadToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/ReadToolInput), or if the file was truncated due to size. By default, the Read tool returns up to 2000 lines. ### StartLine Gets or sets the starting line number (1-based) of the content in this response. #### Syntax ```csharp theme={"dark"} public int StartLine { get; set; } ``` #### Property Value Type: `int` #### Remarks Line numbers in Claude Code are 1-based, meaning the first line of a file is line 1. If an `offset` was specified in the [ReadToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/ReadToolInput), this value will reflect that offset. ### TotalLines Gets or sets the total number of lines in the entire file. #### Syntax ```csharp theme={"dark"} public int TotalLines { get; set; } ``` #### Property Value Type: `int` #### Remarks This represents the complete line count of the file, regardless of how many lines were actually returned in this response. Use this to determine if the file was partially read (when [ReadToolFileInfo.NumLines](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo#numlines) is less than [ReadToolFileInfo.TotalLines](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo#totallines)). ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ReadToolResponse Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolResponse Represents the response payload returned by the Claude Code Read tool after reading a file. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.ReadToolResponse ``` ## Summary Represents the response payload returned by the Claude Code Read tool after reading a file. ## Remarks The Read tool reads files from the local filesystem and returns their content along with metadata about the file. This response is received in the [ReadPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/ReadPostToolUsePayload) when the `tool_name` is "Read". The Read tool supports reading text files, images (PNG, JPG, etc.), PDF files, and Jupyter notebooks (.ipynb). For text files, content is returned with line numbers. For binary files like images, the content is presented visually to Claude as it is a multimodal LLM. Example JSON payload: ```csharp theme={"dark"} { "type": "text", "file": { "filePath": "C:\\Projects\\MyApp\\Program.cs", "content": " 1→using System;\n 2→\n 3→class Program...", "numLines": 50, "startLine": 1, "totalLines": 50 } } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ReadToolResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### File Gets or sets the file information containing the path, content, and line metadata. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.ReadToolFileInfo File { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.ReadToolFileInfo?` #### Remarks This property contains the actual file content and associated metadata such as the number of lines read, the starting line, and the total lines in the file. May be `null` if the file could not be read or does not exist. ### Type Gets or sets the type of content returned by the Read tool. #### Syntax ```csharp theme={"dark"} public string Type { get; set; } ``` #### Property Value Type: `string` #### Remarks Common values include: ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebSearchResultContainer Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchResultContainer Represents a container grouping web search results from a single search operation. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WebSearchResultContainer ``` ## Summary Represents a container grouping web search results from a single search operation. ## Remarks Search results are organized into containers that can be traced back to specific tool invocations using the [WebSearchResultContainer.ToolUseId](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchResultContainer#tooluseid). Each container holds multiple individual search result items. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebSearchResultContainer() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Content Gets or sets the list of individual search result items in this container. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Content { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks Each item represents a single search result with a title and URL. Results are ordered by relevance as determined by the search engine. ### ToolUseId Gets or sets the unique identifier for the tool use that produced these results. #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} "srvtoolu_01Y7zVgSRg9cAvqgZdue61h3" ``` #### Remarks This ID can be used to correlate search results with specific tool invocations in the conversation history. It follows the format `"srvtoolu_"` followed by a unique identifier string. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebSearchResultItem Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchResultItem Represents an individual web search result with a title and URL. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WebSearchResultItem ``` ## Summary Represents an individual web search result with a title and URL. ## Remarks Each search result item provides the essential information needed to understand what the result is about ([WebSearchResultItem.Title](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchResultItem#title)) and where to find more information ([WebSearchResultItem.Url](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchResultItem#url)). The URL can be used with the [WebFetchToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WebFetchToolInput) to retrieve the full content of the page for more detailed information. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebSearchResultItem() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Title Gets or sets the title of the search result. #### Syntax ```csharp theme={"dark"} public string Title { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} "Claude Code Documentation - Anthropic" ``` #### Remarks This is typically the page title or heading from the search result. It provides a brief description of what the linked page contains. ### Url Gets or sets the URL of the search result. #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} "https://docs.anthropic.com/claude-code/overview" ``` #### Remarks This is the direct link to the search result page. The URL can be used with [WebFetchToolInput](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WebFetchToolInput) to retrieve and process the page content. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebSearchToolResponse Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchToolResponse Represents the response payload returned by the Claude Code WebSearch tool after performing a web search. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WebSearchToolResponse ``` ## Summary Represents the response payload returned by the Claude Code WebSearch tool after performing a web search. ## Remarks The WebSearch tool allows Claude to search the web for up-to-date information beyond its training data cutoff. This response is received in the [WebSearchPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebSearchPostToolUsePayload) when the `tool_name` is "WebSearch". Note: Web search is currently only available in the US region. Example JSON payload: ```csharp theme={"dark"} { "query": "Claude Code documentation 2025", "results": [ { "tool_use_id": "srvtoolu_01ABC123...", "content": [ { "title": "Claude Code Documentation", "url": "https://docs.anthropic.com/claude-code" }, { "title": "Getting Started with Claude Code", "url": "https://anthropic.com/claude-code/getting-started" } ] } ], "durationSeconds": 2.45 } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebSearchToolResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DurationSeconds Gets or sets the total duration of the search operation in seconds. #### Syntax ```csharp theme={"dark"} public double DurationSeconds { get; set; } ``` #### Property Value Type: `double` #### Remarks This includes the time taken to perform the web search and process the results. Web searches typically complete within a few seconds, but may take longer depending on network conditions and search complexity. ### Query Gets or sets the search query that was executed. #### Syntax ```csharp theme={"dark"} public string Query { get; set; } ``` #### Property Value Type: `string` #### Remarks This is the exact query string that was sent to the search engine. It matches the [WebSearchToolInput.Query](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/WebSearchToolInput#query) from the input. ### Results Gets or sets the search results returned from the web search. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Results { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks Results are grouped into containers, each containing multiple search result items. The structure allows for multiple result sets from a single search operation. Use these results to inform responses about current events, recent documentation, or other information that may have changed since Claude's training data cutoff. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WriteToolResponse Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WriteToolResponse Represents the response payload returned by the Claude Code Write tool after creating or overwriting a file. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools.Responses **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WriteToolResponse ``` ## Summary Represents the response payload returned by the Claude Code Write tool after creating or overwriting a file. ## Remarks The Write tool creates new files or overwrites existing files on the local filesystem. This response is received in the [WritePostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WritePostToolUsePayload) when the `tool_name` is "Write". Unlike the Edit tool which performs targeted string replacements, the Write tool completely replaces the file content. Claude Code requires that an existing file be read first before it can be overwritten, to prevent accidental data loss. Example JSON payload for a new file: ```csharp theme={"dark"} { "type": "create", "filePath": "C:\\Projects\\MyApp\\NewFile.cs", "content": "using System;\n\nnamespace MyApp { }", "structuredPatch": [], "originalFile": null } ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WriteToolResponse() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Content Gets or sets the content that was written to the file. #### Syntax ```csharp theme={"dark"} public string Content { get; set; } ``` #### Property Value Type: `string` #### Remarks This contains the complete content of the file after the write operation. For new files, this is the entire file content. For overwrites, this is the new content that replaced the original. ### FilePath Gets or sets the absolute path to the file that was written. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string` #### Examples ```csharp theme={"dark"} "C:\\Users\\Developer\\Projects\\MyApp\\src\\NewClass.cs" ``` #### Remarks This is always an absolute path, regardless of whether the original request used a relative or absolute path. On Windows, this will use backslash separators. ### OriginalFile Gets or sets the original file content before the write operation. #### Syntax ```csharp theme={"dark"} public string OriginalFile { get; set; } ``` #### Property Value Type: `string?` #### Remarks This is `null` when creating a new file ([WriteToolResponse.Type](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WriteToolResponse#type) = "create") since there was no previous content. For overwrites, this contains the complete original content of the file before it was replaced, which can be useful for implementing undo functionality or auditing changes. ### StructuredPatch Gets or sets the structured patch representing the changes made to the file. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List StructuredPatch { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` #### Remarks For new files ([WriteToolResponse.Type](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WriteToolResponse#type) = "create"), this will be an empty list since there is no previous content to diff against. For overwrites, this contains a unified diff representation showing what changed between the original and new content. Each [StructuredPatchHunk](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/StructuredPatchHunk) represents a contiguous block of changes. ### Type Gets or sets the type of write operation that was performed. #### Syntax ```csharp theme={"dark"} public string Type { get; set; } ``` #### Property Value Type: `string` #### Remarks Known values include: ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/index Summary of the CloudNimble.ClaudeEssentials.Hooks.Tools.Responses Namespace ## Types ### Classes | Name | Summary | | - | - | | [BashToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/BashToolResponse) | Represents the response payload returned by the Claude Code Bash tool after executing a shell command. | | [EditToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse) | Represents the response payload returned by the Claude Code Edit tool after performing a string replacement in a file. | | [StructuredPatchHunk](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/StructuredPatchHunk) | Represents a single hunk (contiguous block of changes) in a unified diff patch. | | [GlobToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GlobToolResponse) | Represents the response payload returned by the Claude Code Glob tool after searching for files matching a pattern. | | [GrepToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse) | Represents the response payload returned by the Claude Code Grep tool after searching for content within files. | | [KillShellToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/KillShellToolResponse) | Represents the response payload returned by the Claude Code KillShell tool after attempting to terminate a background shell process. | | [NotebookEditToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/NotebookEditToolResponse) | Represents the response payload returned by the Claude Code NotebookEdit tool after modifying a Jupyter notebook cell. | | [ReadToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolResponse) | Represents the response payload returned by the Claude Code Read tool after reading a file. | | [ReadToolFileInfo](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/ReadToolFileInfo) | Contains detailed information about a file read by the Claude Code Read tool, including its path, content, and line-related metadata. | | [TaskToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/TaskToolResponse) | Represents the response payload returned by the Claude Code Task tool after executing a subagent to handle a complex task. | | [TodoWriteToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/TodoWriteToolResponse) | Represents the response payload returned by the Claude Code TodoWrite tool after updating the task list. | | [WebFetchToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebFetchToolResponse) | Represents the response payload returned by the Claude Code WebFetch tool after fetching and processing content from a URL. | | [WebSearchToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchToolResponse) | Represents the response payload returned by the Claude Code WebSearch tool after performing a web search. | | [WebSearchResultContainer](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchResultContainer) | Represents a container grouping web search results from a single search operation. | | [WebSearchResultItem](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WebSearchResultItem) | Represents an individual web search result with a title and URL. | | [WriteToolResponse](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WriteToolResponse) | Represents the response payload returned by the Claude Code Write tool after creating or overwriting a file. | # TaskPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TaskPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the Task tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.TaskPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the Task tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the Task tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "Task". The Task tool launches subagents to handle complex tasks. Your hook receives both the task parameters and the agent's result, enabling logging of agent activity or result processing. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<TaskPostToolUsePayload>(json); Console.WriteLine($"Agent {payload.ToolResponse.AgentId} completed with status: {payload.ToolResponse.Status}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TaskPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TaskToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TaskToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.TaskToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.TaskToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TaskPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TaskPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the Task tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.TaskPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the Task tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the Task tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Task". The Task tool launches subagents to handle complex tasks. Your hook can inspect the task description, agent type, and model before the subagent is spawned. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<TaskPreToolUsePayload>(json); Console.WriteLine($"Launching {payload.ToolInput.SubagentType} agent: {payload.ToolInput.Description}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TaskPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TaskToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TaskToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TodoWritePostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TodoWritePostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the TodoWrite tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.TodoWritePostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the TodoWrite tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the TodoWrite tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "TodoWrite". The TodoWrite tool manages Claude's task list. Your hook receives both the requested changes and the before/after state of the todo list, enabling task tracking or workflow integrations. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<TodoWritePostToolUsePayload>(json); var completed = payload.ToolResponse.NewTodos.Count(t => t.Status == "completed"); Console.WriteLine($"Todo list now has {completed} completed items"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TodoWritePostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoWriteToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoWriteToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.TodoWriteToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.TodoWriteToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # TodoWritePreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TodoWritePreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the TodoWrite tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.TodoWritePreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the TodoWrite tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the TodoWrite tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "TodoWrite". The TodoWrite tool manages Claude's task list. Your hook can inspect the todo items before they are updated, enabling task tracking or workflow integrations. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<TodoWritePreToolUsePayload>(json); Console.WriteLine($"Updating {payload.ToolInput.Todos.Count} todo items"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public TodoWritePreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoWriteToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.TodoWriteToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebFetchPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebFetchPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the WebFetch tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.WebFetchPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the WebFetch tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the WebFetch tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "WebFetch". The WebFetch tool retrieves and processes content from URLs. Your hook receives both the URL and prompt that was used, plus the processed content that was returned. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<WebFetchPostToolUsePayload>(json); Console.WriteLine($"Fetched {payload.ToolInput.Url} in {payload.ToolResponse.DurationSeconds}s"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebFetchPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebFetchToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebFetchToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WebFetchToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WebFetchToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebFetchPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebFetchPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the WebFetch tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.WebFetchPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the WebFetch tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the WebFetch tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "WebFetch". The WebFetch tool retrieves and processes content from URLs. Your hook can inspect the target URL and prompt before the fetch occurs, enabling URL filtering or network access controls. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<WebFetchPreToolUsePayload>(json); Console.WriteLine($"Fetching URL: {payload.ToolInput.Url}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebFetchPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebFetchToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebFetchToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebSearchPostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebSearchPostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the WebSearch tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.WebSearchPostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the WebSearch tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the WebSearch tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "WebSearch". The WebSearch tool searches the web for current information. Your hook receives both the search query and the results returned, enabling search logging or result filtering. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<WebSearchPostToolUsePayload>(json); var resultCount = payload.ToolResponse.Results.SelectMany(r => r.Content).Count(); Console.WriteLine($"Found {resultCount} results for '{payload.ToolInput.Query}'"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebSearchPostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebSearchToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebSearchToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WebSearchToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WebSearchToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WebSearchPreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebSearchPreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the WebSearch tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.WebSearchPreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the WebSearch tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the WebSearch tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "WebSearch". The WebSearch tool searches the web for current information. Your hook can inspect the search query and domain filters before the search occurs, enabling query logging or search restrictions. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<WebSearchPreToolUsePayload>(json); Console.WriteLine($"Searching for: {payload.ToolInput.Query}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WebSearchPreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebSearchToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WebSearchToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WritePostToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WritePostToolUsePayload Represents the complete payload delivered to a PostToolUse hook after the Write tool has executed. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.WritePostToolUsePayload ``` ## Summary Represents the complete payload delivered to a PostToolUse hook after the Write tool has executed. ## Remarks This payload contains all context provided to your hook after Claude executes the Write tool, including session information, the original tool input, and the tool's response. Use this type for strongly-typed deserialization of PostToolUse hook payloads when `tool_name` is "Write". The Write tool creates or overwrites files on the local filesystem. Your hook receives both the intended content and confirmation of what was written, enabling logging or auditing. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<WritePostToolUsePayload>(json); Console.WriteLine($"Wrote {payload.ToolResponse.Type} to {payload.ToolResponse.FilePath}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WritePostToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PostToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolResponse Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput` Gets or sets the response data returned by the tool. The schema depends on the specific tool that was invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WriteToolResponse ToolResponse { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WriteToolResponse?` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # WritePreToolUsePayload Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WritePreToolUsePayload Represents the complete payload delivered to a PreToolUse hook when the Write tool is about to be invoked. ## Definition **Assembly:** CloudNimble.ClaudeEssentials.dll **Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools **Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\ ## Syntax ```csharp theme={"dark"} CloudNimble.ClaudeEssentials.Hooks.Tools.WritePreToolUsePayload ``` ## Summary Represents the complete payload delivered to a PreToolUse hook when the Write tool is about to be invoked. ## Remarks This payload contains all context provided to your hook before Claude executes the Write tool, including session information, the tool input parameters, and permission context. Use this type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Write". The Write tool creates or overwrites files on the local filesystem. Your hook can inspect the target path and content before the write occurs, potentially blocking sensitive operations. \Terminology:\ ## Examples ```csharp theme={"dark"} var payload = JsonSerializer.Deserialize<WritePreToolUsePayload>(json); Console.WriteLine($"Writing to: {payload.ToolInput.FilePath}"); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public WritePreToolUsePayload() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput` #### Syntax ```csharp theme={"dark"} public PreToolUseHookInput() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` #### Syntax ```csharp theme={"dark"} protected ToolHookInputBase() ``` ### .ctor Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` #### Syntax ```csharp theme={"dark"} protected HookInputBase() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CurrentWorkingDirectory Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the current working directory where Claude Code is running. #### Syntax ```csharp theme={"dark"} public string CurrentWorkingDirectory { get; set; } ``` #### Property Value Type: `string` ### HookEventName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the name of the hook event that triggered this input. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName` ### PermissionMode Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the permission mode under which Claude Code is operating. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode` ### SessionId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the unique identifier for the current Claude Code session. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string` ### ToolInput Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the input parameters for the tool. The schema depends on the specific tool being invoked. #### Syntax ```csharp theme={"dark"} public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput ToolInput { get; set; } ``` #### Property Value Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput?` ### ToolName Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the name of the tool being invoked. Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch. MCP tools follow the pattern: mcp\_\_\\_\_\. #### Syntax ```csharp theme={"dark"} public string ToolName { get; set; } ``` #### Property Value Type: `string` ### ToolUseId Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase` Gets or sets the unique identifier for this specific tool use instance. Typically follows the pattern: toolu\_01ABC123... #### Syntax ```csharp theme={"dark"} public string ToolUseId { get; set; } ``` #### Property Value Type: `string` ### TranscriptPath Inherited Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase` Gets or sets the file path to the transcript JSONL file for the current session. This file contains the full conversation history. #### Syntax ```csharp theme={"dark"} public string TranscriptPath { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/index Summary of the CloudNimble.ClaudeEssentials.Hooks.Tools Namespace ## Types ### Classes | Name | Summary | | - | - | | [BashPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/BashPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the Bash tool has executed. | | [BashPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/BashPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the Bash tool is about to be invoked. | | [EditPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/EditPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the Edit tool has executed. | | [EditPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/EditPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the Edit tool is about to be invoked. | | [GlobPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GlobPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the Glob tool has executed. | | [GlobPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GlobPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the Glob tool is about to be invoked. | | [GrepPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GrepPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the Grep tool has executed. | | [GrepPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GrepPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the Grep tool is about to be invoked. | | [KillShellPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/KillShellPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the KillShell tool has executed. | | [KillShellPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/KillShellPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the KillShell tool is about to be invoked. | | [NotebookEditPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/NotebookEditPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the NotebookEdit tool has executed. | | [NotebookEditPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/NotebookEditPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the NotebookEdit tool is about to be invoked. | | [ReadPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/ReadPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the Read tool has executed. | | [ReadPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/ReadPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the Read tool is about to be invoked. | | [TaskPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TaskPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the Task tool has executed. | | [TaskPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TaskPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the Task tool is about to be invoked. | | [TodoWritePostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TodoWritePostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the TodoWrite tool has executed. | | [TodoWritePreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/TodoWritePreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the TodoWrite tool is about to be invoked. | | [WebFetchPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebFetchPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the WebFetch tool has executed. | | [WebFetchPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebFetchPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the WebFetch tool is about to be invoked. | | [WebSearchPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebSearchPostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the WebSearch tool has executed. | | [WebSearchPreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WebSearchPreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the WebSearch tool is about to be invoked. | | [WritePostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WritePostToolUsePayload) | Represents the complete payload delivered to a PostToolUse hook after the Write tool has executed. | | [WritePreToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WritePreToolUsePayload) | Represents the complete payload delivered to a PreToolUse hook when the Write tool is about to be invoked. | # Overview Source: https://easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/index Summary of the CloudNimble.ClaudeEssentials.Hooks Namespace ## Summary The `CloudNimble.ClaudeEssentials.Hooks` namespace provides strongly-typed C# models for building Claude Code hooks. These models represent the JSON input/output schemas that Claude Code uses to communicate with hook executables. ## Key Components * **Inputs**: Classes for deserializing JSON received from Claude Code via stdin * **Outputs**: Classes for serializing JSON responses to stdout * **Enums**: Type-safe representations of hook events, decisions, and modes * **ClaudeHooksSerializer**: AOT-compatible helper methods for JSON serialization * **ClaudeHooksJsonContext**: Source-generated JSON context for Native AOT support ## Usage ### Basic Hook Pattern A Claude Code hook is an executable that: 1. Reads JSON from stdin 2. Processes the input 3. Writes JSON to stdout 4. Exits with an appropriate code (0 = success, 2 = blocking error) ```csharp theme={"dark"} using CloudNimble.ClaudeEssentials.Hooks; using CloudNimble.ClaudeEssentials.Hooks.Inputs; using CloudNimble.ClaudeEssentials.Hooks.Outputs; // Read input from stdin var json = Console.In.ReadToEnd(); var input = ClaudeHooksSerializer.DeserializePreToolUseInput(json); // Process and respond var output = new PreToolUseHookOutput { Continue = true }; Console.WriteLine(ClaudeHooksSerializer.SerializePreToolUseOutput(output)); ``` ### Hook Configuration Configure hooks in `~/.claude/settings.json` or `.claude/settings.json`: ```json theme={"dark"} { "hooks": { "PreToolUse": [ { "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "my-hook.exe" }] } ] } } ``` ## Examples ### PreToolUse: Auto-approve safe tools ```csharp theme={"dark"} var input = ClaudeHooksSerializer.DeserializePreToolUseInput(Console.In.ReadToEnd()); var output = new PreToolUseHookOutput { HookSpecificOutput = new PreToolUseSpecificOutput { PermissionDecision = input?.ToolName == "Read" ? PermissionDecision.Allow : PermissionDecision.Ask, PermissionDecisionReason = "Read operations are safe" } }; Console.WriteLine(ClaudeHooksSerializer.SerializePreToolUseOutput(output)); ``` ### PostToolUse: Log tool executions ```csharp theme={"dark"} var input = ClaudeHooksSerializer.DeserializePostToolUseInput(Console.In.ReadToEnd()); File.AppendAllText("hooks.log", $"{DateTime.Now}: {input?.ToolName}\n"); Console.WriteLine(ClaudeHooksSerializer.SerializePostToolUseOutput(new PostToolUseHookOutput())); ``` ### Stop: Require confirmation before stopping ```csharp theme={"dark"} var input = ClaudeHooksSerializer.DeserializeStopInput(Console.In.ReadToEnd()); var output = new StopHookOutput { Decision = HookDecision.Block, Reason = "Please confirm all tests pass before stopping." }; Console.WriteLine(ClaudeHooksSerializer.SerializeStopOutput(output)); ``` ## Types ### Classes | Name | Summary | | - | - | | [ClaudeHooksJsonContext](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/ClaudeHooksJsonContext) | Provides AOT-compatible JSON serialization context for Claude Code hook types. This context uses source generators to pre-compile serialization code, eliminating the need for runtime reflection. | | [ClaudeHooksSerializer](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/ClaudeHooksSerializer) | Provides static helper methods for serializing and deserializing Claude Code hook types. All methods use the AOT-compatible [ClaudeHooksJsonContext](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/ClaudeHooksJsonContext) for serialization. | | [CompactTrigger](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/CompactTrigger) | Represents what triggered a compact operation. | | [HookDecision](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookDecision) | Represents a hook's decision to block or allow an operation. | | [HookEventName](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookEventName) | Represents the different types of hook events that can be triggered in Claude Code. | | [NotificationType](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/NotificationType) | Represents the type of notification sent by Claude Code. | | [PermissionDecision](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionDecision) | Represents the decision for a PreToolUse permission check. | | [PermissionMode](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionMode) | Represents the permission mode under which Claude Code is operating. | | [PermissionRequestBehavior](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionRequestBehavior) | Represents the behavior decision for a PermissionRequest hook. | | [SessionEndReason](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/SessionEndReason) | Represents the reason why a session ended. | | [SessionStartSource](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/SessionStartSource) | Represents the source that triggered a session start event. | ### Enums | Name | Summary | | - | - | | [CompactTrigger](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/CompactTrigger) | Represents what triggered a compact operation. | | [HookDecision](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookDecision) | Represents a hook's decision to block or allow an operation. | | [HookEventName](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/HookEventName) | Represents the different types of hook events that can be triggered in Claude Code. | | [NotificationType](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/NotificationType) | Represents the type of notification sent by Claude Code. | | [PermissionDecision](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionDecision) | Represents the decision for a PreToolUse permission check. | | [PermissionMode](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionMode) | Represents the permission mode under which Claude Code is operating. | | [PermissionRequestBehavior](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/PermissionRequestBehavior) | Represents the behavior decision for a PermissionRequest hook. | | [SessionEndReason](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/SessionEndReason) | Represents the reason why a session ended. | | [SessionStartSource](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/SessionStartSource) | Represents the source that triggered a session start event. | # Understanding Claude Code Hooks Source: https://easyaf.dev/claudeessentials/guides/understanding-hooks A deep dive into Claude Code hook payloads, naming conventions, and the quirks ClaudeEssentials handles for you # Understanding Claude Code Hooks **Good news:** ClaudeEssentials handles all of the serialization quirks documented below automatically. You don't need to worry about these details when using our library. This guide exists for two reasons: 1. **Transparency** - So you understand what's happening under the hood when debugging issues 2. **Advocacy** - To document these inconsistencies so Anthropic can address them in future versions of Claude Code When building integrations with Claude Code hooks, you'll encounter several naming convention inconsistencies that can cause serialization failures if not handled correctly. This guide documents these quirks so you understand what ClaudeEssentials is doing for you. ## Property Naming: The snake\_case / camelCase Split One of the most surprising aspects of Claude Code hooks is that **inputs and outputs use different naming conventions**. ### Hook Inputs: snake\_case All properties in hook input payloads from Claude Code use `snake_case`: ```json theme={"dark"} { "session_id": "abc-123", "transcript_path": "/path/to/transcript.jsonl", "cwd": "/working/directory", "permission_mode": "default", "hook_event_name": "PreToolUse", "tool_name": "Bash", "tool_input": { ... }, "tool_use_id": "toolu_01ABC123" } ``` ClaudeEssentials handles this automatically with `[JsonPropertyName("snake_case")]` attributes on all input types. ### Hook Outputs: camelCase When your hook returns a response to Claude Code, all properties must use `camelCase`: ```json theme={"dark"} { "continue": true, "stopReason": "Operation blocked by policy", "suppressOutput": false, "systemMessage": "Additional context for Claude", "hookSpecificOutput": { "hookEventName": "PreToolUse", "permissionDecision": "allow", "permissionDecisionReason": "Approved by automation" } } ``` **Why this matters:** Using the wrong casing will cause Claude Code to ignore your hook output silently. There's no error message - the hook simply won't have the intended effect. This is why ClaudeEssentials uses explicit `[JsonPropertyName]` attributes on all output types. ## Enum Value Casing: The Inconsistent Trio Claude Code expects different casing for different enum types. Getting these wrong results in `JsonException` errors during deserialization. ClaudeEssentials uses `[JsonStringEnumMemberName]` attributes to handle each case correctly. ### HookEventName: PascalCase The `hook_event_name` property uses PascalCase values: ```json theme={"dark"} { "hook_event_name": "PreToolUse" } ``` Valid values: * `PreToolUse` * `PostToolUse` * `PermissionRequest` * `UserPromptSubmit` * `Notification` * `Stop` * `SubagentStop` * `PreCompact` * `SessionStart` * `SessionEnd` ### PermissionMode: camelCase The `permission_mode` property uses camelCase values: ```json theme={"dark"} { "permission_mode": "acceptEdits" } ``` Valid values: * `default` * `plan` * `acceptEdits` * `bypassPermissions` ### PermissionDecision: lowercase The `permissionDecision` property in hook outputs uses all lowercase: ```json theme={"dark"} { "hookSpecificOutput": { "permissionDecision": "allow" } } ``` Valid values: * `allow` * `deny` * `ask` ClaudeEssentials uses `[JsonStringEnumMemberName]` attributes on all enums to ensure correct serialization. Each enum has the appropriate casing baked in, so you can use the natural C# enum values without worrying about JSON serialization. ## Quick Reference Table | Context | Convention | Example | | - | - | - | | Input property names | snake\_case | `hook_event_name`, `tool_input`, `permission_mode` | | Output property names | camelCase | `hookSpecificOutput`, `permissionDecision`, `stopReason` | | HookEventName values | PascalCase | `PreToolUse`, `PostToolUse`, `SessionStart` | | PermissionMode values | camelCase | `default`, `acceptEdits`, `bypassPermissions` | | PermissionDecision values | lowercase | `allow`, `deny`, `ask` | ## Common Errors and Solutions These are errors you might see if building your own serialization, or issues ClaudeEssentials prevents: ### "The JSON value could not be converted to PermissionMode" **Cause:** Using wrong casing for `permission_mode` value. **Solution:** Use camelCase: `"acceptEdits"` not `"AcceptEdits"`. **ClaudeEssentials fix:** `[JsonStringEnumMemberName("acceptEdits")]` on enum values. ### "The JSON value could not be converted to PermissionDecision" **Cause:** Using wrong casing for `permissionDecision` value in output. **Solution:** Use lowercase: `"allow"` not `"Allow"`. **ClaudeEssentials fix:** `[JsonStringEnumMemberName("allow")]` on enum values. ### Hook output has no effect **Cause:** Using snake\_case for output properties. **Solution:** Use camelCase: `"hookSpecificOutput"` not `"hook_specific_output"`. **ClaudeEssentials fix:** `[JsonPropertyName("hookSpecificOutput")]` on output properties. ## Summary All naming conventions and enum casing are handled automatically through JSON attributes. Just use the library types. All serialization uses source generators and `JsonTypeInfo` for ahead-of-time compilation support. Our test suite uses actual Claude Code hook payloads captured from production usage. **For Anthropic:** We hope these inconsistencies can be addressed in a future version of Claude Code to provide a more consistent developer experience. Specifically: * Standardizing on a single casing convention for both inputs and outputs * Standardizing enum value casing across all enum types # ClaudeEssentials Documentation Source: https://easyaf.dev/claudeessentials/index AOT-ready .NET models for Claude Code hooks # ClaudeEssentials A lightweight, AOT-compatible .NET library for building [Claude Code](https://docs.anthropic.com/en/docs/claude-code) hook processors. Serialize and deserialize hook payloads with zero reflection overhead. Design philosophy and what makes this library different Get up and running in under 5 minutes ## What Are Claude Code Hooks? Claude Code hooks let you intercept and customize Claude's behavior at key points during a session. ClaudeEssentials provides strongly-typed C# models for all hook events: | Hook | Purpose | | - | - | | `PreToolUse` | Approve, deny, or modify tool calls before execution | | `PostToolUse` | Add context or take action after tools complete | | `Stop` | Enforce policies before Claude ends a session | | `SessionStart` | Inject project context when sessions begin | | `Notification` | React to permission prompts and other notifications | ## Features Source-generated serialization with zero reflection Full IntelliSense and compile-time safety No dependencies beyond System.Text.Json ## Documentation Complete documentation for all types and members Input/output models and serialization helpers # Quickstart Source: https://easyaf.dev/claudeessentials/quickstart Build a Claude Code hook processor in minutes Add ClaudeEssentials to your project: ```bash .NET CLI theme={"dark"} dotnet add package ClaudeEssentials ``` ```powershell Package Manager theme={"dark"} Install-Package ClaudeEssentials ``` For AOT publishing, ensure your project targets .NET 8+ and has `PublishAot` enabled. Create a console app that reads JSON from stdin and writes the response to stdout: ```csharp Program.cs theme={"dark"} using CloudNimble.ClaudeEssentials.Hooks; using CloudNimble.ClaudeEssentials.Hooks.Enums; using CloudNimble.ClaudeEssentials.Hooks.Outputs; // Read hook input from stdin var inputJson = Console.In.ReadToEnd(); // Deserialize the input var input = ClaudeHooksSerializer.DeserializePreToolUseInput(inputJson); // Create your response var output = new PreToolUseHookOutput { Continue = true, HookSpecificOutput = new PreToolUseSpecificOutput { PermissionDecision = PermissionDecision.Allow, PermissionDecisionReason = "Auto-approved by policy" } }; // Write JSON to stdout Console.WriteLine(ClaudeHooksSerializer.SerializePreToolUseOutput(output)); ``` Add your hook to Claude Code's `settings.json`: ```json settings.json theme={"dark"} { "hooks": { "PreToolUse": [{ "command": "dotnet run --project /path/to/your/project" }] } } ``` For production, publish your app as a native executable for faster startup: ```bash theme={"dark"} dotnet publish -c Release ``` Start a Claude Code session. Your hook will now intercept tool calls and apply your custom logic. You're ready to customize Claude's behavior with strongly-typed C# code! ## Common Patterns ```csharp theme={"dark"} if (input.ToolName is "Read" or "Glob" or "Grep") { return new PreToolUseHookOutput { Continue = true, HookSpecificOutput = new PreToolUseSpecificOutput { PermissionDecision = PermissionDecision.Allow } }; } ``` ```csharp theme={"dark"} var command = input.ToolInput?.ToString() ?? ""; if (command.Contains("rm -rf")) { return new PreToolUseHookOutput { Continue = true, HookSpecificOutput = new PreToolUseSpecificOutput { PermissionDecision = PermissionDecision.Deny, PermissionDecisionReason = "Dangerous command blocked" } }; } ``` ```csharp theme={"dark"} return new PostToolUseHookOutput { Continue = true, HookSpecificOutput = new PostToolUseSpecificOutput { AdditionalContext = "Remember to run tests after making changes." } }; ``` ## Next Steps Explore all available types and methods Learn about input models for each hook type # Why ClaudeEssentials? Source: https://easyaf.dev/claudeessentials/why-claudeessentials The motivation behind ClaudeEssentials and what makes it different ## The Problem Claude Code hooks communicate via JSON over stdin/stdout. Building hook processors means: * Manually crafting JSON schemas that match Claude's expectations * Handling snake\_case property names and nullable fields * Ensuring your code works with AOT compilation for fast startup * Testing serialization round-trips to catch subtle bugs ClaudeEssentials solves all of this with a single NuGet package. ## Design Principles Source-generated serialization means zero reflection at runtime. Your hooks start instantly. Strongly-typed models catch errors at compile time, not when Claude calls your hook. Only requires System.Text.Json. No bloat, no conflicts, no surprises. Every input deserializes correctly. Every output serializes to valid JSON. Guaranteed by tests. ## What's Included ### Input Models Strongly-typed classes for every hook event Claude Code can trigger: * `PreToolUseHookInput` — Tool name, input parameters, permission mode * `PostToolUseHookInput` — Tool input plus the response * `StopHookInput` — Session context when Claude wants to stop * `SessionStartHookInput` — Project path, source (startup vs resume) * And more: `Notification`, `UserPromptSubmit`, `PreCompact`, `SessionEnd` ### Output Models Response types with all the fields Claude Code expects: * `PreToolUseHookOutput` — Allow, deny, or ask for permission * `PostToolUseHookOutput` — Add context for Claude to consider * `StopHookOutput` — Block stopping or add a warning * `SessionStartHookOutput` — Inject project context ### Serialization Helpers `ClaudeHooksSerializer` provides typed methods that use the pre-compiled `ClaudeHooksJsonContext`: ```csharp theme={"dark"} // Deserialize input var input = ClaudeHooksSerializer.DeserializePreToolUseInput(json); // Serialize output var json = ClaudeHooksSerializer.SerializePreToolUseOutput(output); ``` ## Use Cases Auto-approve read-only tools while requiring confirmation for file modifications. Block dangerous commands entirely. Use Stop hooks to ensure tests pass before Claude completes a task. Warn about uncommitted changes. Detect project type on SessionStart and inject relevant context—framework version, test commands, team guidelines. Log every tool call for compliance. Track what Claude does across sessions. ## Get Started Build your first hook processor Explore all available types # MSBuild Integration for .NET 10 Source: https://easyaf.dev/guides/MSBuild/dotnet-10-changes Critical changes to EasyAF.MSBuild integration for compatibility across .NET 8, 9, and 10 # MSBuild Integration Changes for .NET 10 ## Overview EasyAF 4.0 includes significant changes to how `EasyAF.MSBuild` integrates with the MSBuild SDK. These changes were necessary to ensure compatibility across .NET 8, .NET 9, and .NET 10 when using `MSBuildLocator` to dynamically load MSBuild assemblies. ## The Problem ### Background: How MSBuildLocator Works `MSBuildLocator` is a Microsoft library that allows applications to dynamically discover and load the MSBuild assemblies from an installed .NET SDK, rather than shipping specific versions of MSBuild with your application. This is the recommended approach for tools that need to manipulate `.csproj` files. The workflow is: 1. Call `MSBuildLocator.RegisterInstance()` or `RegisterDefaults()` **before** any MSBuild types are accessed 2. MSBuildLocator sets up assembly resolution to redirect `Microsoft.Build.*` assembly loads to the SDK's copies 3. Your code can then use MSBuild APIs, and the correct SDK assemblies are loaded ### What Broke in .NET 10 When running on .NET 10 SDK with .NET 8 as the target framework, tests began failing with errors like: ``` Could not load type 'Microsoft.Build.Shared.IMSBuildElementLocation' from assembly 'Microsoft.Build.Framework, Version=15.1.0.0' ``` **Root Cause**: The `Microsoft.Build` NuGet packages were being copied to the application's output directory. When code accessed MSBuild types, the CLR loaded these local assemblies **before** `MSBuildLocator` could redirect to the SDK's assemblies. This created a version mismatch - the NuGet package's assembly version (15.1.0.0) didn't match what the SDK expected. ### Why .NET 10 Exposed This On .NET 10, `MSBuildLocator.QueryVisualStudioInstances()` returns SDK instances filtered by runtime compatibility: * **.NET 8 runtime** only sees SDKs ≤ 8.x (e.g., 8.0.415, 7.0.410, 6.0.428) * **.NET 10 runtime** sees SDKs ≤ 10.x (e.g., 10.0.100, 9.0.307, 8.0.415) The original code filtered for `Version.Major >= 17`, thinking these were Visual Studio versions (17.x = VS 2022). But on .NET Core, these are **SDK versions** (8.x, 9.x, 10.x), so the filter excluded everything, falling back to `RegisterDefaults()` which then failed because assemblies were already loaded. ## The Solution ### 1. Exclude MSBuild Assemblies from Runtime Output The key fix is preventing the `Microsoft.Build.*` NuGet packages from being copied to the output directory. This is done using `ExcludeAssets="runtime"`: ```xml theme={"dark"} ``` * **`ExcludeAssets="runtime"`**: Prevents the DLLs from being copied to the output directory * **`PrivateAssets="all"`**: Prevents these dependencies from flowing to consuming projects * **`Microsoft.Build.Locator`**: Intentionally has NO exclusions - it must be in the output directory ### 2. Provide Dependencies via .targets File For NuGet package consumers, a `.targets` file is included that provides the same package references: **`build/EasyAF.MSBuild.targets`**: ```xml theme={"dark"} ``` This file is included in both `build/` and `buildTransitive/` folders of the NuGet package, ensuring it's imported by direct and transitive consumers. ### 3. Simplified MSBuild Registration The `EnsureMSBuildRegistered()` method was simplified to explicitly pick the latest available SDK: ```csharp theme={"dark"} public static void EnsureMSBuildRegistered() { if (!MSBuildLocator.IsRegistered) { try { var instances = MSBuildLocator.QueryVisualStudioInstances().ToList(); var latestInstance = instances .OrderByDescending(x => x.Version) .FirstOrDefault(); if (latestInstance is not null) { MSBuildLocator.RegisterInstance(latestInstance); } else { MSBuildLocator.RegisterDefaults(); } } catch (InvalidOperationException ex) when (ex.Message.Contains("assemblies were already loaded")) { // Already using loaded MSBuild, continue return; } } } ``` ### 4. Early Registration in Applications and Tests **Critical**: `EnsureMSBuildRegistered()` must be called **before** any code that references `Microsoft.Build` types is loaded by the CLR. **For applications** (like `EasyAF.Tools`), call it at the start of `Main()`: ```csharp theme={"dark"} public static Task Main(string[] args) { MSBuildProjectManager.EnsureMSBuildRegistered(); return Host.CreateDefaultBuilder() // ... rest of application } ``` **For test projects**, use `[AssemblyInitialize]`: ```csharp theme={"dark"} [TestClass] public static class AssemblyInitialize { [AssemblyInitialize] public static void Initialize(TestContext context) { MSBuildProjectManager.EnsureMSBuildRegistered(); } } ``` ## Summary of Changes | File | Change | | - | - | | `CloudNimble.EasyAF.MSBuild.csproj` | Added `ExcludeAssets="runtime" PrivateAssets="all"` to Microsoft.Build packages | | `build/EasyAF.MSBuild.targets` | New file providing package references to NuGet consumers | | `MSBuildProjectManager.cs` | Simplified `EnsureMSBuildRegistered()` to pick latest SDK | | Application `Program.cs` | Call `EnsureMSBuildRegistered()` at start of `Main()` | | Test `AssemblyInitialize.cs` | New file with `[AssemblyInitialize]` calling `EnsureMSBuildRegistered()` | ## For Library Consumers If you're consuming `EasyAF.MSBuild` and need to use MSBuild APIs in your own code: 1. **Always call `MSBuildProjectManager.EnsureMSBuildRegistered()` early** - before any code that uses `Microsoft.Build` types 2. **For CLI tools**: Call it at the start of `Main()` 3. **For test projects**: Use `[AssemblyInitialize]` 4. **For libraries**: Document that consumers must register MSBuild before using your library ## References * [MSBuildLocator GitHub](https://github.com/microsoft/MSBuildLocator) * [MSBuildLocator .NET SDK Discovery](https://github.com/microsoft/MSBuildLocator/wiki/Finding-MSBuild-instances) * [MSBuild Find and Use API](https://learn.microsoft.com/en-us/visualstudio/msbuild/updating-an-existing-application) # Business Layer Source: https://easyaf.dev/guides/business-layer Encapsulate business logic, data operations, and entity lifecycle management with manager classes # Business Layer Documentation ## Overview The Business namespace provides a hierarchy of manager classes that encapsulate business logic, data operations, and entity lifecycle management. These managers integrate with Entity Framework, provide automatic audit trail support, and include hooks for custom business logic. ## Class Hierarchy ``` ManagerBase └── EntityManager └── IdentifiableEntityManager ├── StatusEntityManager └── StateMachineEntityManager ``` ## ManagerBase The foundation class providing database context and message publishing capabilities. ### Properties * **DataContext**: The Entity Framework DbContext for database operations * **MessagePublisher**: IMessagePublisher for event-driven architecture ### Usage ```csharp theme={"dark"} public class CustomManager : ManagerBase { public CustomManager(MyDbContext context, IMessagePublisher publisher) : base(context, publisher) { } public async Task PerformBusinessOperation() { // Access DataContext for queries var data = await DataContext.Customers.ToListAsync(); // Publish events await MessagePublisher.PublishAsync(new CustomerEvent()); } } ``` ## EntityManager Core manager providing CRUD operations with automatic audit trail support and lifecycle hooks. ### Key Features * **Automatic Audit Fields**: Populates created/updated timestamps and user IDs * **Lifecycle Hooks**: Virtual methods for pre/post operation business logic * **Batch Operations**: Efficient handling of multiple entities * **Direct Operations**: Bypass entity loading for performance-critical updates/deletes * **Interface Caching**: Performance optimization using TypeDictionary ### Lifecycle Hooks Each CRUD operation provides pre and post hooks: ```csharp theme={"dark"} public class ProductManager : EntityManager { public override async Task OnInsertingAsync(Product entity) { await base.OnInsertingAsync(entity); // Handles audit fields // Custom validation if (string.IsNullOrWhiteSpace(entity.SKU)) entity.SKU = GenerateSKU(); } public override async Task OnInsertedAsync(Product entity) { // Send notification await MessagePublisher.PublishAsync(new ProductCreatedEvent { ProductId = entity.Id }); return await base.OnInsertedAsync(entity); } } ``` ### Audit Field Population Automatically handles interfaces: * **`ICreatorTrackable`**: Sets CreatedById from ClaimsPrincipal.Current * **`ICreatedAuditable`**: Sets DateCreated to DateTime.UtcNow * **`IUpdaterTrackable`**: Sets UpdatedById from ClaimsPrincipal.Current * **`IUpdatedAuditable`**: Sets DateUpdated to DateTime.UtcNow ### CRUD Operations #### Insert Operations ```csharp theme={"dark"} // Single entity await manager.InsertAsync(entity, save: true); // Multiple entities (batch) await manager.InsertAsync(entities, save: true); // With custom context await manager.InsertAsync(entity, customContext, save: true); ``` #### Update Operations ```csharp theme={"dark"} // Single entity await manager.UpdateAsync(entity, save: true); // Multiple entities await manager.UpdateAsync(entities, save: true); // Direct update without loading entities await manager.DirectUpdateAsync( e => e.Status == "Pending", e => new Product { Status = "Active" } ); ``` #### Delete Operations ```csharp theme={"dark"} // Single entity await manager.DeleteAsync(entity, save: true); // Multiple entities await manager.DeleteAsync(entities, save: true); // Direct delete without loading await manager.DirectDeleteAsync(e => e.IsDeleted == true); ``` ### Performance Features * **Deferred Save**: Pass `save: false` to batch multiple operations * **Direct Operations**: Update/delete without loading entities into context * **Interface Caching**: Static dictionary prevents repeated reflection ## IdentifiableEntityManager Extends EntityManager for entities with ID properties (implementing `IIdentifiable`). ### Key Feature * **Automatic GUID Generation**: Creates new GUIDs for entities with empty IDs during insertion ### Example ```csharp theme={"dark"} public class OrderManager : IdentifiableEntityManager { public override async Task OnInsertingAsync(Order entity) { // ID is automatically set if empty await base.OnInsertingAsync(entity); // Custom logic entity.OrderNumber = GenerateOrderNumber(); } } ``` ## StatusEntityManager Manages entities with status tracking (implementing `IHasStatus`). ### Features * **Status Type Management**: Loads and caches available status types * **Status Updates**: Type-safe status transitions with logging ### Properties * **StatusTypes**: Collection of available TStatusType instances ### Methods ```csharp theme={"dark"} // Initialize status types from database manager.Initialize(); // Update entity status by sort order await manager.UpdateStatusAsync(entity, sortOrder: 10); ``` ### Example Implementation ```csharp theme={"dark"} public class InvoiceManager : StatusEntityManager { public async Task MarkAsPaid(Invoice invoice) { // Update to "Paid" status (assuming sortOrder 50) await UpdateStatusAsync(invoice, 50); // Additional business logic await SendPaymentConfirmation(invoice); } } ``` ## StateMachineEntityManager Manages entities with state machine workflows (implementing `IHasState`). ### Features * **State Type Management**: Loads and caches available state types * **Predefined State Transitions**: Common workflow states with standard sort orders * **State Update Logging**: Automatic tracing of state transitions ### Properties * **StateTypes**: Collection of available TStateType instances ### Standard State Methods ```csharp theme={"dark"} // Standard workflow states await manager.SetCreatedAsync(entity); // sortOrder: 0 await manager.SetCancelledAsync(entity); // sortOrder: 98 await manager.SetFailedAsync(entity); // sortOrder: 99 await manager.SetCompletedAsync(entity); // sortOrder: 100 // Custom state by sort order await manager.UpdateStateAsync(entity, sortOrder: 25); ``` ### State Machine Convention * **0**: Created/Initial state * **1-97**: Custom intermediate states * **98**: Cancelled (terminal state) * **99**: Failed (terminal state) * **100**: Completed (terminal state) ### Example Workflow ```csharp theme={"dark"} public class WorkflowManager : StateMachineEntityManager { public async Task ProcessWorkflow(WorkflowItem item) { // Start workflow await SetCreatedAsync(item); try { // Move through states await UpdateStateAsync(item, 10); // "In Review" await UpdateStateAsync(item, 20); // "Approved" await UpdateStateAsync(item, 30); // "Processing" // Complete await SetCompletedAsync(item); } catch (Exception ex) { // Handle failure await SetFailedAsync(item, ex.Message, ex.ToString()); } } } ``` ## Best Practices 1. **Inherit from Appropriate Manager**: Choose the most specific manager for your needs 2. **Override Hooks Sparingly**: Only override what you need; call base implementations 3. **Use Direct Operations for Bulk**: DirectUpdate/DirectDelete for performance 4. **Initialize Collections Early**: Call Initialize() in manager constructors for status/state 5. **Leverage Deferred Save**: Batch operations with `save: false` then SaveChangesAsync() 6. **Handle Exceptions in Hooks**: Ensure robust error handling in lifecycle methods 7. **Use Message Publishing**: Publish events for downstream systems in OnInserted/OnUpdated ## Integration with Interfaces The managers automatically detect and handle these interfaces: * **`IIdentifiable`**: Entity has an ID property * **`ICreatedAuditable`**: Track creation timestamp * **`IUpdatedAuditable`**: Track update timestamp * **`ICreatorTrackable`**: Track user who created * **`IUpdaterTrackable`**: Track user who updated * **`IHasStatus`**: Entity has status type * **`IHasState`**: Entity participates in state machine ## Thread Safety * **Static Interface Dictionary**: Thread-safe type caching * **Instance Methods**: Not thread-safe; use separate manager instances per request/scope # Data Operations & Audit Source: https://easyaf.dev/guides/data-operations-and-audit Comprehensive data operation management with automatic audit trail creation and user tracking # Data Operations and Audit Documentation ## Overview EasyAF provides comprehensive data operation management with automatic audit trail creation, user tracking, and data integrity maintenance through a system of interfaces and manager classes. This document explains how these components work together to ensure data consistency and traceability. ## Core Interfaces for Data Operations ### Identity Management #### `IIdentifiable` Ensures entities have a unique identifier. ```csharp theme={"dark"} public interface IIdentifiable where T : struct { T Id { get; set; } } ``` **Usage**: All entities that need unique identification should implement this interface. The framework automatically generates GUIDs for entities when T is Guid. ### Audit Trail Interfaces #### ICreatedAuditable Tracks when an entity was created. ```csharp theme={"dark"} public interface ICreatedAuditable { DateTimeOffset DateCreated { get; set; } } ``` #### IUpdatedAuditable Tracks when an entity was last updated. ```csharp theme={"dark"} public interface IUpdatedAuditable { DateTimeOffset? DateUpdated { get; set; } } ``` **Note**: DateUpdated is nullable since entities may never be updated after creation. ### User Tracking Interfaces #### `ICreatorTrackable` Tracks which user created an entity. ```csharp theme={"dark"} public interface ICreatorTrackable where T : struct { T CreatedById { get; set; } } ``` #### `IUpdaterTrackable` Tracks which user last updated an entity. ```csharp theme={"dark"} public interface IUpdaterTrackable where T : struct { T? UpdatedById { get; set; } } ``` **Note**: UpdatedById is nullable since the entity may not have been updated yet. **Supported ID types**: `Guid` (the EasyAF default), `int`, and `long`. The EntityManager converts the current user's ID claim to whichever type the entity declares. For `int` and `long`, a missing or non-numeric claim leaves the ID unchanged. **CreatedById must be required**: every record has a creator, so `CreatedById` must be `NOT NULL` in the database. If a table's `CreatedById` allows nulls, code generation leaves off `ICreatorTrackable` and reports warning **EASYAF005** at the column in your EDMX. To track built-in or seed data, assign it to a system user ID that has zero permissions. ## Automatic Audit Field Population The EntityManager automatically detects and populates audit fields based on implemented interfaces. ### During Insert Operations ```csharp theme={"dark"} public virtual async Task OnInsertingAsync(TEntity entity) { // Auto-set creator if ICreatorTrackable is implemented if (entity is ICreatorTrackable trackable && ClaimsPrincipal.Current != null) { trackable.CreatedById = ClaimsPrincipal.Current.GetIdClaim(); } // Auto-set creation date if ICreatedAuditable is implemented if (entity is ICreatedAuditable auditable) { auditable.DateCreated = DateTime.UtcNow; } } ``` ### During Update Operations ```csharp theme={"dark"} public virtual async Task OnUpdatingAsync(TEntity entity) { // Auto-set updater if IUpdaterTrackable is implemented if (entity is IUpdaterTrackable trackable && ClaimsPrincipal.Current != null) { trackable.UpdatedById = ClaimsPrincipal.Current.GetIdClaim(); } // Auto-set update date if IUpdatedAuditable is implemented if (entity is IUpdatedAuditable auditable) { auditable.DateUpdated = DateTime.UtcNow; } } ``` ## Entity Definition Best Practices ### Complete Auditable Entity ```csharp theme={"dark"} public class AuditableEntity : DbObservableObject, IIdentifiable, ICreatedAuditable, IUpdatedAuditable, ICreatorTrackable, IUpdaterTrackable { // Identity public Guid Id { get; set; } // Audit timestamps public DateTimeOffset DateCreated { get; set; } public DateTimeOffset? DateUpdated { get; set; } // User tracking public Guid CreatedById { get; set; } public Guid? UpdatedById { get; set; } // Navigation properties (optional) public User CreatedBy { get; set; } public User UpdatedBy { get; set; } // Business properties public string Name { get; set; } public string Description { get; set; } } ``` ## Data Operation Flow ### Insert Flow 1. **Client creates entity** → New instance with business data 2. **Manager.InsertAsync() called** → Initiates insert operation 3. **OnInsertingAsync() executed** → * ID generated (if `IIdentifiable`) * CreatedById set (if `ICreatorTrackable`) * DateCreated set (if `ICreatedAuditable`) 4. **Entity added to context** → EntityState.Added 5. **SaveChangesAsync()** → Database insert 6. **OnInsertedAsync() executed** → Post-insert logic (events, notifications) ### Update Flow 1. **Entity retrieved and modified** → Property changes tracked 2. **Manager.UpdateAsync() called** → Initiates update operation 3. **OnUpdatingAsync() executed** → * UpdatedById set (if `IUpdaterTrackable`) * DateUpdated set (if `IUpdatedAuditable`) 4. **Entity marked modified** → EntityState.Modified 5. **SaveChangesAsync()** → Database update 6. **OnUpdatedAsync() executed** → Post-update logic ### Delete Flow 1. **Entity marked for deletion** → Soft or hard delete decision 2. **Manager.DeleteAsync() called** → Initiates delete operation 3. **OnDeletingAsync() executed** → Pre-delete validation/logic 4. **Entity marked deleted** → EntityState.Deleted 5. **SaveChangesAsync()** → Database delete 6. **OnDeletedAsync() executed** → Post-delete cleanup ## Advanced Data Operations ### Batch Operations Audit fields are populated for each entity in batch operations: ```csharp theme={"dark"} public async Task OnInsertingAsync(List entities) { foreach (var entity in entities) { await OnInsertingAsync(entity); // Each gets audit fields } } ``` ### Direct Operations (Performance) Direct operations bypass entity loading and audit field population: ```csharp theme={"dark"} // Direct update - no audit fields populated await manager.DirectUpdateAsync( e => e.Status == "Pending", e => new Order { Status = "Processing" } ); // Direct delete - no OnDeleting/OnDeleted hooks await manager.DirectDeleteAsync(e => e.IsDeleted == true); ``` **Use Cases**: * Bulk status updates * Cleanup operations * Performance-critical scenarios **Trade-offs**: * No automatic audit trail * No business logic hooks * Better performance ### Manual Audit Reset For special scenarios like entity duplication: ```csharp theme={"dark"} public void ResetAuditProperties(TDbObservable entity) where TDbObservable : DbObservableObject { if (entity is ICreatorTrackable creator) creator.CreatedById = ClaimsPrincipal.Current.GetIdClaim(); if (entity is ICreatedAuditable created) created.DateCreated = DateTime.UtcNow; if (entity is IUpdaterTrackable updater) updater.UpdatedById = null; // Clear update tracking if (entity is IUpdatedAuditable updated) updated.DateUpdated = null; // Clear update timestamp } ``` ## Data Integrity Patterns ### Soft Delete Pattern ```csharp theme={"dark"} public interface ISoftDeletable : IUpdatedAuditable, IUpdaterTrackable { bool IsDeleted { get; set; } DateTimeOffset? DateDeleted { get; set; } Guid? DeletedById { get; set; } } public override async Task OnDeletingAsync(TEntity entity) { if (entity is ISoftDeletable softDelete) { softDelete.IsDeleted = true; softDelete.DateDeleted = DateTime.UtcNow; softDelete.DeletedById = ClaimsPrincipal.Current?.GetIdClaim(); // Change to update instead of delete DataContext.Entry(entity).State = EntityState.Modified; } } ``` ### Versioning Pattern ```csharp theme={"dark"} public interface IVersionable { int Version { get; set; } byte[] RowVersion { get; set; } // For optimistic concurrency } public override async Task OnUpdatingAsync(TEntity entity) { await base.OnUpdatingAsync(entity); if (entity is IVersionable versionable) { versionable.Version++; } } ``` ### Active Record Pattern ```csharp theme={"dark"} public interface IActiveTrackable { bool IsActive { get; set; } } // Query only active records var activeItems = DataContext.Set() .Where(e => (e as IActiveTrackable).IsActive) .ToList(); ``` ## Security Considerations ### User Context The framework relies on `ClaimsPrincipal.Current` for user identification: ```csharp theme={"dark"} // Ensure user context is available if (ClaimsPrincipal.Current == null) { throw new UnauthorizedAccessException("User context required for audit operations"); } ``` ### Audit Trail Immutability Once set, audit fields should not be modified: ```csharp theme={"dark"} public DateTimeOffset DateCreated { get => _dateCreated; set { if (_dateCreated != default) throw new InvalidOperationException("DateCreated cannot be modified"); _dateCreated = value; } } ``` ## Integration with Change Tracking DbObservableObject's change tracking works with audit fields: ```csharp theme={"dark"} var entity = new Customer(); entity.TrackChanges(); entity.Name = "New Name"; // Tracked // DateUpdated will be set on save // UpdatedById will be set on save var delta = entity.ToDeltaPayload(); // Delta includes: { Id, Name, DateUpdated, UpdatedById } ``` ## Best Practices 1. **Always implement audit interfaces**: Provides crucial traceability 2. **Use nullable types for update fields**: Not all entities get updated 3. **Leverage automatic population**: Don't manually set audit fields 4. **Consider soft deletes**: Maintain data history and recovery options 5. **Use direct operations judiciously**: Balance performance vs audit needs 6. **Implement versioning for critical entities**: Detect concurrent modifications 7. **Validate user context**: Ensure ClaimsPrincipal.Current is available 8. **Test audit trail**: Verify fields are populated correctly 9. **Document bypass scenarios**: When audit fields won't be populated 10. **Consider timezone handling**: Store as UTC, display in local time # Guides Overview Source: https://easyaf.dev/guides/index In-depth guides for building applications with EasyAF # EasyAF Guides Welcome to the EasyAF guides. These in-depth articles cover the core concepts and patterns you'll use when building applications with the EasyAF framework. ## Foundation Understand EasyAF's opinionated database design through composable interfaces Implement property change notification and change tracking ## Business Logic Encapsulate business logic with manager classes Automatic audit trails and user tracking ## Advanced Topics Database-driven state machines and status management Time-based financial and rate calculations # Interval Calculations Source: https://easyaf.dev/guides/interval-calculations Understanding the EasyAF interval calculation system for time-based financial and rate calculations # Interval Calculations in EasyAF The EasyAF library provides a powerful and flexible system for handling time-based calculations through its `Interval` class hierarchy. This system enables you to work with frequencies, rates, and monetary amounts across different time periods with automatic conversion capabilities. ## Core Concepts ### Base Interval Class The foundation of the system is the `Interval` class, which represents **frequency** - how often something occurs over time. The key insight is that an interval represents "time per occurrence," not "occurrences per time." ```csharp theme={"dark"} // Example: Making widgets // If it takes 1.5 hours to make 1 widget, how many widgets per day? var widgetInterval = new Interval(1.5, IntervalType.Hours); decimal widgetsPerDay = widgetInterval.PerDay(); // 16 widgets (24 hours ÷ 1.5 hours) ``` ### Key Properties * **Value**: Always represents a time duration (e.g., 1.5 hours, 3 days, 2 weeks) * **Type**: The time unit for the Value (Hours, Days, Weeks, Months, Years) ### Method Types The interval classes provide two distinct types of calculation methods: 1. \**Per* methods (inherited)\*\*: Calculate interval frequency - how many intervals fit in a time period 2. **Specialized rate methods**: Calculate total amounts for derived classes (money, ratios, percentages) ## Interval Types ### 1. Base Interval Class Calculates pure frequency - how many intervals occur within different time periods. ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours var productionInterval = new Interval(1.5, IntervalType.Hours); decimal widgetsPerHour = productionInterval.PerHour(); // 0.67 widgets decimal widgetsPerDay = productionInterval.PerDay(); // 16 widgets decimal widgetsPerWeek = productionInterval.PerWeek(); // 112 widgets decimal widgetsPerMonth = productionInterval.PerMonth(); // 486.67 widgets decimal widgetsPerYear = productionInterval.PerYear(); // 5840 widgets ``` ### 2. MoneyInterval Class Represents financial amounts that occur at regular intervals. Unlike other derived classes, `MoneyInterval` **overrides** the base methods to directly return monetary amounts. ```csharp theme={"dark"} // Salary: $100 every 1.5 hours var salaryInterval = new MoneyInterval(100m, 1.5, IntervalType.Hours); // These return dollar amounts directly decimal dollarsPerHour = salaryInterval.PerHour(); // $66.67 decimal dollarsPerDay = salaryInterval.PerDay(); // $1600.00 decimal dollarsPerWeek = salaryInterval.PerWeek(); // $11,200.00 decimal dollarsPerMonth = salaryInterval.PerMonth(); // $48,666.67 decimal dollarsPerYear = salaryInterval.PerYear(); // $584,000.00 ``` #### MoneyInterval ToString Methods ```csharp theme={"dark"} var salary = new MoneyInterval(75000m, 1, IntervalType.Years); string display1 = salary.ToString(); // "$75,000.00 / 1 year" string display2 = salary.ToString(0); // "$75,000 / 1 year" string display3 = salary.ToString(2); // "$75,000.00 / 1 year" ``` ### 3. RatioInterval Class Combines base interval calculations with ratio multiplication. Provides both inherited frequency methods and new ratio calculation methods. ```csharp theme={"dark"} // Conversion rate: 70% success every 2 weeks var conversionInterval = new RatioInterval(0.70m, 2, IntervalType.Weeks); // Frequency methods (inherited) - how many 2-week periods? decimal periodsPerMonth = conversionInterval.PerMonth(); // 2.17 periods decimal periodsPerYear = conversionInterval.PerYear(); // 26 periods // Ratio methods - total conversion amounts decimal ratioPerWeek = conversionInterval.RatioPerWeek(); // 0.35 (0.70 × 0.5) decimal ratioPerMonth = conversionInterval.RatioPerMonth(); // 1.52 (0.70 × 2.17) decimal ratioPerYear = conversionInterval.RatioPerYear(); // 18.2 (0.70 × 26) ``` #### RatioInterval Use Cases ```csharp theme={"dark"} // Performance metrics: 95% efficiency every 8 hours var efficiencyInterval = new RatioInterval(0.95m, 8, IntervalType.Hours); decimal efficiencyPerDay = efficiencyInterval.RatioPerDay(); // 2.85 (0.95 × 3) // Quality metrics: 99.5% success rate every day var qualityInterval = new RatioInterval(0.995m, 1, IntervalType.Days); decimal qualityPerWeek = qualityInterval.RatioPerWeek(); // 6.965 (0.995 × 7) ``` ### 4. PercentageInterval Class Similar to RatioInterval but designed specifically for percentage-based calculations. Uses `Rate` property and provides `RatePer*` methods. ```csharp theme={"dark"} // Interest rate: 2.5% every quarter (3 months) var interestInterval = new PercentageInterval(0.025m, 3, IntervalType.Months); // Frequency methods (inherited) - how many quarters? decimal quartersPerYear = interestInterval.PerYear(); // 4 quarters // Rate methods - total interest percentages decimal ratePerMonth = interestInterval.RatePerMonth(); // 0.0083 (0.025 × 0.33) decimal ratePerYear = interestInterval.RatePerYear(); // 0.10 (0.025 × 4) ``` #### PercentageInterval Use Cases ```csharp theme={"dark"} // Growth rate: 5% growth every month var growthInterval = new PercentageInterval(0.05m, 1, IntervalType.Months); decimal annualGrowth = growthInterval.RatePerYear(); // 0.60 (0.05 × 12) // Discount rate: 10% discount every week var discountInterval = new PercentageInterval(0.10m, 1, IntervalType.Weeks); decimal monthlyDiscount = discountInterval.RatePerMonth(); // 0.434 (0.10 × 4.34) // Error rate: 0.1% error rate every hour var errorInterval = new PercentageInterval(0.001m, 1, IntervalType.Hours); decimal dailyErrorRate = errorInterval.RatePerDay(); // 0.024 (0.001 × 24) ``` ## Advanced Examples ### Complex Financial Scenarios ```csharp theme={"dark"} // Freelance work: $150 every 2.5 hours var freelanceWork = new MoneyInterval(150m, 2.5, IntervalType.Hours); decimal hourlyRate = freelanceWork.PerHour(); // $60.00 decimal dailyEarnings = freelanceWork.PerDay(); // $1,440.00 (24 ÷ 2.5 × $150) decimal weeklyEarnings = freelanceWork.PerWeek(); // $10,080.00 decimal monthlyEarnings = freelanceWork.PerMonth(); // $43,733.33 decimal annualEarnings = freelanceWork.PerYear(); // $524,800.00 // NEW: Calculate earnings for specific work hours decimal earnings8Hours = freelanceWork.PerDay(8); // $11,520.00 (for 8 hours of work) decimal earnings40Hours = freelanceWork.PerWeek(40); // $403,200.00 (for 40 hours of work) ``` ### Quantity-Based Calculations The new overloaded methods allow you to directly calculate results for specific quantities: #### Widget Production with Materials ```csharp theme={"dark"} // Widget production: 1 widget every 1.5 hours var production = new Interval(1.5, IntervalType.Hours); // Traditional calculation decimal widgetsPerHour = production.PerHour(); // 0.67 widgets decimal widgetsFrom100Materials = widgetsPerHour * 100; // 66.67 widgets // NEW: Direct calculation with quantity decimal totalWidgetsPerHour = production.PerHour(100); // 66.67 widgets (direct) decimal totalWidgetsPerDay = production.PerDay(100); // 1,600 widgets ``` #### Lead Conversion with Customer Quantities ```csharp theme={"dark"} // Sales conversion: 70% conversion rate every month var conversion = new RatioInterval(0.70m, 1, IntervalType.Months); // Traditional calculation decimal conversionRate = conversion.RatioPerMonth(); // 0.70 decimal conversionsFrom30 = conversionRate * 30; // 21 customers // NEW: Direct calculation with customer quantity decimal totalConversions = conversion.RatioPerMonth(30); // 21 customers (direct) decimal weeklyConversions = conversion.RatioPerWeek(30); // ~4.88 customers decimal dailyConversions = conversion.RatioPerDay(30); // ~0.69 customers ``` #### Interest Calculations with Principal Amounts ```csharp theme={"dark"} // Interest rate: 2.5% every quarter (3 months) var interest = new PercentageInterval(0.025m, 3, IntervalType.Months); // Traditional calculation decimal quarterlyRate = interest.RatePerYear(); // 0.10 (10% annually) decimal interestOn50k = quarterlyRate * 50000; // $5,000 // NEW: Direct calculation with principal amount decimal annualInterest = interest.RatePerYear(50000); // $5,000 (direct) decimal monthlyInterest = interest.RatePerMonth(50000); // ~$416.67 decimal dailyInterest = interest.RatePerDay(50000); // ~$13.70 ``` ### Performance and Conversion Tracking ```csharp theme={"dark"} // Sales conversion: 35% conversion rate every 3 days var salesConversion = new RatioInterval(0.35m, 3, IntervalType.Days); // How many 3-day periods per week? decimal periodsPerWeek = salesConversion.PerWeek(); // 2.33 periods // Total conversion rate per week? decimal weeklyConversion = salesConversion.RatioPerWeek(); // 0.817 (0.35 × 2.33) // Monthly conversion totals decimal monthlyConversion = salesConversion.RatioPerMonth(); // 3.62 (0.35 × 10.33) ``` ### Interest and Growth Calculations ```csharp theme={"dark"} // Compound interest: 1.2% every month var monthlyInterest = new PercentageInterval(0.012m, 1, IntervalType.Months); decimal quarterlyRate = monthlyInterest.RatePerMonth() * 3; // 0.036 (3.6% per quarter) decimal annualRate = monthlyInterest.RatePerYear(); // 0.144 (14.4% per year) // Investment growth: 8% every quarter var quarterlyGrowth = new PercentageInterval(0.08m, 3, IntervalType.Months); decimal annualGrowthRate = quarterlyGrowth.RatePerYear(); // 0.32 (32% per year) ``` ## Method Reference ### Base Interval Methods (All Classes) These methods calculate frequency - how many intervals fit within the specified time period: * `PerMinute()` - Intervals per minute * `PerHour()` - Intervals per hour * `PerDay()` - Intervals per day * `PerWeek()` - Intervals per week * `PerMonth()` - Intervals per month * `PerYear()` - Intervals per year **NEW: Quantity-based overloads:** * `PerMinute(decimal quantity)` - Total output per minute for given quantity * `PerHour(decimal quantity)` - Total output per hour for given quantity * `PerDay(decimal quantity)` - Total output per day for given quantity * `PerWeek(decimal quantity)` - Total output per week for given quantity * `PerMonth(decimal quantity)` - Total output per month for given quantity * `PerYear(decimal quantity)` - Total output per year for given quantity ### MoneyInterval Methods MoneyInterval **overrides** the base methods to return monetary amounts: * `PerMinute()` - Dollars per minute * `PerHour()` - Dollars per hour * `PerDay()` - Dollars per day * `PerWeek()` - Dollars per week * `PerMonth()` - Dollars per month * `PerYear()` - Dollars per year **NEW: Quantity-based overloads (e.g., hours worked, units sold):** * `PerMinute(decimal quantity)` - Total earnings per minute for given quantity * `PerHour(decimal quantity)` - Total earnings per hour for given quantity * `PerDay(decimal quantity)` - Total earnings per day for given quantity * `PerWeek(decimal quantity)` - Total earnings per week for given quantity * `PerMonth(decimal quantity)` - Total earnings per month for given quantity * `PerYear(decimal quantity)` - Total earnings per year for given quantity ### RatioInterval Methods RatioInterval provides both inherited frequency methods and new ratio methods: **Frequency methods (inherited):** * `PerMinute()`, `PerHour()`, `PerDay()`, etc. - Number of intervals per time period * `PerMinute(decimal quantity)`, `PerHour(decimal quantity)`, etc. - Total output for given quantity **Ratio methods:** * `RatioPerMinute()` - Total ratio per minute (intervals × ratio) * `RatioPerHour()` - Total ratio per hour * `RatioPerDay()` - Total ratio per day * `RatioPerWeek()` - Total ratio per week * `RatioPerMonth()` - Total ratio per month * `RatioPerYear()` - Total ratio per year **NEW: Quantity-based ratio overloads:** * `RatioPerMinute(decimal quantity)` - Total ratio applied to quantity per minute * `RatioPerHour(decimal quantity)` - Total ratio applied to quantity per hour * `RatioPerDay(decimal quantity)` - Total ratio applied to quantity per day * `RatioPerWeek(decimal quantity)` - Total ratio applied to quantity per week * `RatioPerMonth(decimal quantity)` - Total ratio applied to quantity per month * `RatioPerYear(decimal quantity)` - Total ratio applied to quantity per year ### PercentageInterval Methods PercentageInterval provides both inherited frequency methods and new rate methods: **Frequency methods (inherited):** * `PerMinute()`, `PerHour()`, `PerDay()`, etc. - Number of intervals per time period * `PerMinute(decimal quantity)`, `PerHour(decimal quantity)`, etc. - Total output for given quantity **Rate methods:** * `RatePerMinute()` - Total rate per minute (intervals × rate) * `RatePerHour()` - Total rate per hour * `RatePerDay()` - Total rate per day * `RatePerWeek()` - Total rate per week * `RatePerMonth()` - Total rate per month * `RatePerYear()` - Total rate per year **NEW: Principal-based rate overloads:** * `RatePerMinute(decimal principal)` - Total rate applied to principal per minute * `RatePerHour(decimal principal)` - Total rate applied to principal per hour * `RatePerDay(decimal principal)` - Total rate applied to principal per day * `RatePerWeek(decimal principal)` - Total rate applied to principal per week * `RatePerMonth(decimal principal)` - Total rate applied to principal per month * `RatePerYear(decimal principal)` - Total rate applied to principal per year ## Time Conversion Constants The system uses these conversion factors for calculations: * **Minutes per hour**: 60 * **Hours per day**: 24 * **Days per week**: 7 * **Days per month**: 30.4375 (365.25 ÷ 12) * **Days per year**: 365.25 * **Weeks per month**: 4.345 (30.4375 ÷ 7) * **Months per year**: 12 ## Best Practices ### 1. Choose the Right Class * Use `Interval` for pure frequency calculations * Use `MoneyInterval` for financial amounts where you want direct monetary results * Use `RatioInterval` for general ratio/rate calculations where you need both frequency and rate methods * Use `PercentageInterval` for percentage-based calculations ### 2. Understanding Method Behavior ```csharp theme={"dark"} // MoneyInterval overrides base methods var salary = new MoneyInterval(50m, 1, IntervalType.Hours); decimal dollarsPerHour = salary.PerHour(); // $50.00 (direct monetary amount) // RatioInterval keeps base methods and adds new ones var conversion = new RatioInterval(0.5m, 1, IntervalType.Hours); decimal intervalsPerHour = conversion.PerHour(); // 1.0 (frequency) decimal ratioPerHour = conversion.RatioPerHour(); // 0.5 (rate calculation) ``` ### 3. Precision Considerations All calculations return `decimal` values for maximum precision in financial and rate calculations. Be aware that some conversions may result in repeating decimals. ### 4. Validation Always validate input values: ```csharp theme={"dark"} // Ensure positive values for time durations if (Convert.ToDecimal(value) <= 0) throw new ArgumentException("Interval value must be positive"); // Validate reasonable ranges for rates and percentages if (rate < 0 || rate > 1) throw new ArgumentException("Rate should be between 0 and 1"); ``` This interval system provides a robust foundation for time-based calculations across financial, performance, and analytical scenarios in your applications. # Observable Objects Source: https://easyaf.dev/guides/observable-objects Implement property change notification and change tracking with EasyObservableObject and DbObservableObject # Observable Objects Documentation ## Overview EasyAF provides two foundational classes for implementing property change notification and change tracking in your entities: `EasyObservableObject` and `DbObservableObject`. These classes form the basis for all data-aware entities in the EasyAF framework. ## EasyObservableObject `EasyObservableObject` is the base class that implements `INotifyPropertyChanged` for WPF/XAML data binding scenarios. ### Key Features * **Property Change Notification**: Automatically raises `PropertyChanged` events when property values change * **Type-Safe Property Setting**: Provides strongly-typed methods to set properties with automatic change detection * **Deep Cloning**: Built-in JSON-based deep clone functionality * **Disposable Pattern**: Implements `IDisposable` for proper resource cleanup ### Usage Pattern ```csharp theme={"dark"} public class Person : EasyObservableObject { private string _name; private int _age; public string Name { get => _name; set => Set(nameof(Name), ref _name, value); } public int Age { get => _age; set => Set(() => Age, ref _age, value); // Expression-based alternative } } ``` ### Methods * **`Set(propertyName, ref field, newValue)`**: Sets a property value and raises PropertyChanged if the value changes * **`Set(propertyExpression, ref field, newValue)`**: Expression-based property setter for compile-time safety * **`RaisePropertyChanged(propertyName)`**: Manually raises the PropertyChanged event * **`Clone()`**: Creates a deep copy of the object using JSON serialization ## DbObservableObject `DbObservableObject` extends `EasyObservableObject` and adds comprehensive change tracking capabilities for Entity Framework scenarios. It implements `IChangeTracking` and `IRevertibleChangeTracking`. ### Key Features * **Change Tracking**: Tracks original values and modifications to properties * **Graph Traversal**: Can track changes across entire object graphs (related entities) * **Revertible Changes**: Supports accepting or rejecting changes * **Delta Payloads**: Generates minimal update payloads containing only changed properties * **Relationship Management**: Utilities for clearing navigation properties before API calls ### Properties * **IsChanged**: Indicates if the entity has been modified * **IsGraphChanged**: Indicates if any entity in the object graph has been modified * **OriginalValues**: Dictionary storing original property values before changes * **ShouldTrackChanges**: Controls whether changes are tracked ### Change Tracking Workflow 1. **Start Tracking**: Call `TrackChanges(deepTracking)` to begin monitoring changes 2. **Make Changes**: Modify properties using the inherited `Set` methods 3. **Check Status**: Use `IsChanged` or `IsGraphChanged` to determine if modifications occurred 4. **Accept/Reject**: Call `AcceptChanges()` to commit or `RejectChanges()` to rollback ### Example Usage ```csharp theme={"dark"} public class Customer : DbObservableObject { private string _name; private string _email; private List _orders; public string Name { get => _name; set => Set(nameof(Name), ref _name, value); } public string Email { get => _email; set => Set(nameof(Email), ref _email, value); } public List Orders { get => _orders; set => Set(nameof(Orders), ref _orders, value); } } // Usage var customer = GetCustomer(); customer.TrackChanges(true); // Track entire graph customer.Name = "New Name"; customer.Orders[0].Status = "Shipped"; if (customer.IsGraphChanged) { var delta = customer.ToDeltaPayload(true); // Get only changed properties await UpdateCustomer(delta); customer.AcceptChanges(true); // Clear tracking after successful save } ``` ### Key Methods * **TrackChanges(deepTracking)**: Starts tracking property changes * **AcceptChanges(goDeep)**: Clears tracking and marks entity as unchanged * **RejectChanges(goDeep)**: Reverts all properties to original values * **ToDeltaPayload(deepTracking)**: Creates an ExpandoObject with only changed properties * **ClearRelationships()**: Sets all navigation properties to null (useful for API operations) * **GetRelatedEntityProperties()**: Returns PropertyInfo for all single-entity navigation properties * **GetRelatedEntityCollectionProperties()**: Returns PropertyInfo for all collection navigation properties ### Deep Tracking When `deepTracking` is enabled: * Changes are tracked across the entire object graph * Related entities and collections are automatically included * Circular references are handled to prevent infinite loops * Delta payloads include nested changes ## Integration Points Both observable objects integrate seamlessly with: * **Entity Framework**: Change tracking aligns with EF's state management * **WPF/XAML Binding**: PropertyChanged events update UI automatically * **Business Layer**: EntityManager classes leverage these for audit trails * **API Operations**: Delta payloads minimize network traffic for updates ## Best Practices 1. **Always use Set() methods**: Ensures proper change notification and tracking 2. **Enable tracking before modifications**: Call TrackChanges() before making changes 3. **Clear relationships for APIs**: Use ClearRelationships() before serializing for OData/REST 4. **Accept changes after save**: Call AcceptChanges() after successful database operations 5. **Use deep tracking sparingly**: Graph traversal can be expensive for large object graphs 6. **Dispose properly**: Call Dispose() when objects are no longer needed ## Performance Considerations * **Property Setting**: Minimal overhead with equality checking preventing unnecessary events * **Deep Tracking**: Can be expensive for large graphs; use selectively * **Delta Payloads**: Reduces payload size but requires traversal computation * **Clone Operations**: Uses JSON serialization which may be slow for complex objects # Property Name Overrides Source: https://easyaf.dev/guides/property-name-overrides Customize CLR property names when scaffolding from databases with different naming conventions ## Overview When scaffolding Entity Framework Core models from an existing database, you may encounter databases that use naming conventions that don't align with C# coding standards. For example, a PostgreSQL database might have columns named `NIIN`, `FSC`, `INC`, while C# conventions prefer `Niin`, `Fsc`, `Inc`. The Property Name Overrides feature in EasyAF.EFCoreToEdmx allows you to define custom mappings between database column names and CLR property names while maintaining accurate EDMX generation. ## Features * **Custom Property Naming**: Map database column names to C# property names on a per-entity basis * **Automatic HasColumnName Generation**: Injects `HasColumnName()` calls in `OnModelCreating` * **IgnoreTrackingFields Support**: Automatically adds `IgnoreTrackingFields()` for all entities * **Self-Reference Fixes**: Improves naming for self-referential relationships (InverseParent → Children) ## Configuration Add a `propertyNameOverrides` section to your `.edmx.config` file: ```json theme={"dark"} { "connectionStringSource": "appsettings.json:ConnectionStrings:DefaultConnection", "provider": "PostgreSQL", "contextName": "MyDbContext", "propertyNameOverrides": { "NationalStockNumber": { "NIIN": "Niin", "FSC": "Fsc", "INC": "Inc", "SOS": "Sos" }, "Agent": { "SSN": "SocialSecurityNumber", "DOB": "DateOfBirth" } } } ``` ### Configuration Structure * **Outer Dictionary Key**: Entity name (after pluralization, e.g., "NationalStockNumber" not "NationalStockNumbers") * **Inner Dictionary**: * **Key**: Database column name (e.g., "NIIN") * **Value**: Desired CLR property name (e.g., "Niin") ## How It Works ### 1. Database Scaffolding When scaffolding from your database, EF Core generates entities with properties that match C# naming conventions: ```csharp theme={"dark"} public class NationalStockNumber { public string Niin { get; set; } // Database column: NIIN public string Fsc { get; set; } // Database column: FSC } ``` ### 2. OnModelCreating Enhancement The scaffolder enhances the `OnModelCreating` method with: **Before Enhancement:** ```csharp theme={"dark"} modelBuilder.Entity(entity => { entity.Property(e => e.Niin).HasMaxLength(9); entity.Property(e => e.Fsc).HasMaxLength(4); }); ``` **After Enhancement:** ```csharp theme={"dark"} modelBuilder.Entity(entity => { entity.IgnoreTrackingFields(); entity.Property(e => e.Niin) .HasColumnName("NIIN") .HasMaxLength(9); entity.Property(e => e.Fsc) .HasColumnName("FSC") .HasMaxLength(4); }); ``` ### 3. EDMX Generation The EDMX file correctly maps: * **SSDL (Storage)**: Uses actual database column names (NIIN, FSC) * **CSDL (Conceptual)**: Uses CLR property names (Niin, Fsc) * **MSL (Mapping)**: Maps between storage and conceptual names ## Benefits ### 1. Database Accuracy Maintains `UseDatabaseNames = true` for accurate database column representation while allowing custom CLR naming. ### 2. Clean Code Generation Generated entities follow C# naming conventions while preserving database column mappings. ### 3. Tracking Fields Support Automatically adds `IgnoreTrackingFields()` for entities that implement tracking interfaces like `ICreatedAuditable` or `IUpdatedAuditable`. ### 4. Backward Compatibility Existing configurations without `propertyNameOverrides` continue to work unchanged. ## Common Scenarios ### PostgreSQL with Uppercase Columns ```json theme={"dark"} "propertyNameOverrides": { "Product": { "PRODUCT_ID": "ProductId", "PRODUCT_NAME": "ProductName", "UNIT_PRICE": "UnitPrice" } } ``` ### Legacy Database with Abbreviations ```json theme={"dark"} "propertyNameOverrides": { "Customer": { "CUST_ID": "CustomerId", "ADDR": "Address", "PHONE_NUM": "PhoneNumber" } } ``` ### Mixed Naming Conventions ```json theme={"dark"} "propertyNameOverrides": { "Order": { "order_id": "OrderId", "CustomerID": "CustomerId", "ORDER_DATE": "OrderDate" } } ``` ## Best Practices 1. **Entity Names**: Use the singular entity name in configuration, not the pluralized table name 2. **Consistency**: Apply consistent naming patterns across related entities 3. **Documentation**: Document why specific overrides are needed for future developers 4. **Testing**: Verify generated EDMX files map correctly to your database schema ## Troubleshooting ### HasColumnName Not Generated * Verify the entity name matches exactly (case-sensitive) * Check that the database column name in the config matches the actual database * Ensure `UseDatabaseNames` is set to `true` (default) ### IgnoreTrackingFields Not Added * Confirm you're using the latest version of EasyAF.EFCoreToEdmx * Check console output during scaffolding for any enhancement errors ### Self-References Still Show InverseParent * The enhancement automatically fixes this, but verify no custom navigation properties override the fix ## Example: Complete Configuration ```json theme={"dark"} { "connectionStringSource": "appsettings.json:ConnectionStrings:VibraniumDb", "provider": "PostgreSQL", "contextName": "VibraniumDbContext", "dbContextNamespace": "Sustainment.Vibranium.Data", "objectsNamespace": "Sustainment.Vibranium.Core", "usePluralizer": true, "useDataAnnotations": false, "includedTables": [ "FederalSupplyClasses", "FederalSupplyGroups", "NationalStockNumbers", "Parts", "ReportParts" ], "propertyNameOverrides": { "NationalStockNumber": { "NIIN": "Niin", "FSC": "Fsc", "INC": "Inc", "SOS": "Sos" }, "Part": { "PART_ID": "PartId", "PARENT_ID": "ParentId" } } } ``` This configuration will: 1. Scaffold only the specified tables 2. Apply custom property names for NationalStockNumber and Part entities 3. Generate HasColumnName() calls for mapped properties 4. Add IgnoreTrackingFields() to all entities 5. Fix any self-referential relationships # State Machines & Status Source: https://easyaf.dev/guides/state-machines-and-status Sophisticated state machine and status management through database-driven enumerations # State Machines and Status Enums Documentation ## Overview EasyAF provides a sophisticated state machine and status management system through database-driven enumerations. This approach allows dynamic workflow configuration without code changes while maintaining type safety and data integrity. ## Core Concepts ### Database-Driven Enumerations Traditional enums are compile-time constants. EasyAF's database-driven approach provides: * **Runtime Configurability**: Add/modify states without recompiling * **Historical Integrity**: Old records maintain valid references * **Rich Metadata**: States include display text, instructions, and transitions * **Active/Inactive States**: Disable states without breaking existing data ### Status vs State * **Status**: Simple categorization (e.g., Active, Inactive, Pending) * **State**: Complex workflow positions with transitions (e.g., Created → Processing → Completed) ## Interface Hierarchy ### Base Interfaces #### IDbEnum Foundation for all database enumerations: ```csharp theme={"dark"} public interface IDbEnum : IIdentifiable, IActiveTrackable, IHumanReadable, ISortable { // Combines: // - Guid Id (unique identifier) // - bool IsActive (enabled/disabled) // - string DisplayName (user-friendly text) // - int SortOrder (ordering/progression) } ``` #### IActiveTrackable Controls availability: ```csharp theme={"dark"} public interface IActiveTrackable { bool IsActive { get; set; } // False = hidden from new selections } ``` #### IHumanReadable User-facing text: ```csharp theme={"dark"} public interface IHumanReadable { string DisplayName { get; set; } // "Pending Approval" } ``` #### ISortable Defines order and progression: ```csharp theme={"dark"} public interface ISortable { int SortOrder { get; set; } // 0, 10, 20, etc. } ``` ### Status Interfaces #### IDbStatusEnum Simple status enumeration: ```csharp theme={"dark"} public interface IDbStatusEnum : IDbEnum { // Inherits all IDbEnum properties // No additional properties - simple categorization } ``` #### `IHasStatus` Entities with status: ```csharp theme={"dark"} public interface IHasStatus : IIdentifiable where T : class, IDbStatusEnum { T StatusType { get; set; } // Navigation property Guid StatusTypeId { get; set; } // Foreign key } ``` ### State Machine Interfaces #### IDbStateEnum Rich state with transitions: ```csharp theme={"dark"} public interface IDbStateEnum : IDbEnum { // Instructions for current state string InstructionText { get; set; } // Primary transition (success path) string PrimaryTargetDisplayText { get; set; } // "Approve" int PrimaryTargetSortOrder { get; set; } // Next state: 20 // Secondary transition (alternate path) string SecondaryTargetDisplayText { get; set; } // "Reject" int SecondaryTargetSortOrder { get; set; } // Alt state: 99 } ``` #### `IHasState` Entities in state machine: ```csharp theme={"dark"} public interface IHasState : IIdentifiable where T : class, IDbStateEnum { T StateType { get; set; } // Navigation property Guid StateTypeId { get; set; } // Foreign key } ``` ## Implementation Examples ### Status Entity Simple status tracking for invoices: ```csharp theme={"dark"} // Status type definition public class InvoiceStatus : DbObservableObject, IDbStatusEnum { public Guid Id { get; set; } public string DisplayName { get; set; } public int SortOrder { get; set; } public bool IsActive { get; set; } } // Entity using status public class Invoice : DbObservableObject, IHasStatus { public Guid Id { get; set; } public string InvoiceNumber { get; set; } public decimal Amount { get; set; } // Status relationship public Guid StatusTypeId { get; set; } public InvoiceStatus StatusType { get; set; } } // Database seed data var statuses = new[] { new InvoiceStatus { Id = Guid.NewGuid(), DisplayName = "Draft", SortOrder = 0, IsActive = true }, new InvoiceStatus { Id = Guid.NewGuid(), DisplayName = "Sent", SortOrder = 10, IsActive = true }, new InvoiceStatus { Id = Guid.NewGuid(), DisplayName = "Paid", SortOrder = 20, IsActive = true }, new InvoiceStatus { Id = Guid.NewGuid(), DisplayName = "Overdue", SortOrder = 30, IsActive = true }, new InvoiceStatus { Id = Guid.NewGuid(), DisplayName = "Cancelled", SortOrder = 99, IsActive = true } }; ``` ### State Machine Entity Complex workflow with transitions: ```csharp theme={"dark"} // State type with transitions public class ApprovalState : DbObservableObject, IDbStateEnum { public Guid Id { get; set; } public string DisplayName { get; set; } public int SortOrder { get; set; } public bool IsActive { get; set; } // State machine specific public string InstructionText { get; set; } public string PrimaryTargetDisplayText { get; set; } public int PrimaryTargetSortOrder { get; set; } public string SecondaryTargetDisplayText { get; set; } public int SecondaryTargetSortOrder { get; set; } } // Entity in workflow public class ApprovalRequest : DbObservableObject, IHasState { public Guid Id { get; set; } public string Title { get; set; } public string Description { get; set; } // State relationship public Guid StateTypeId { get; set; } public ApprovalState StateType { get; set; } } // Database seed data with transitions var states = new[] { new ApprovalState { Id = Guid.NewGuid(), DisplayName = "Created", SortOrder = 0, IsActive = true, InstructionText = "Request created and awaiting submission", PrimaryTargetDisplayText = "Submit for Review", PrimaryTargetSortOrder = 10, SecondaryTargetDisplayText = "Cancel", SecondaryTargetSortOrder = 98 }, new ApprovalState { Id = Guid.NewGuid(), DisplayName = "Under Review", SortOrder = 10, IsActive = true, InstructionText = "Request is being reviewed by approver", PrimaryTargetDisplayText = "Approve", PrimaryTargetSortOrder = 20, SecondaryTargetDisplayText = "Reject", SecondaryTargetSortOrder = 99 }, new ApprovalState { Id = Guid.NewGuid(), DisplayName = "Approved", SortOrder = 20, IsActive = true, InstructionText = "Request has been approved", PrimaryTargetDisplayText = "Complete", PrimaryTargetSortOrder = 100, SecondaryTargetDisplayText = "Revert to Review", SecondaryTargetSortOrder = 10 } }; ``` ## Manager Integration ### StatusEntityManager Usage ```csharp theme={"dark"} public class InvoiceManager : StatusEntityManager { public InvoiceManager(AppContext context, IMessagePublisher publisher) : base(context, publisher) { Initialize(); // Load status types } public async Task MarkAsPaid(Invoice invoice) { // Update to "Paid" status (sortOrder = 20) var result = await UpdateStatusAsync(invoice, 20); if (result) { await MessagePublisher.PublishAsync(new InvoicePaidEvent { InvoiceId = invoice.Id }); } return result; } public async Task> GetOverdueInvoices() { var overdueStatus = StatusTypes.First(s => s.DisplayName == "Overdue"); return await DataContext.Invoices .Where(i => i.StatusTypeId == overdueStatus.Id) .ToListAsync(); } } ``` ### StateMachineEntityManager Usage ```csharp theme={"dark"} public class ApprovalManager : StateMachineEntityManager { public ApprovalManager(AppContext context, IMessagePublisher publisher) : base(context, publisher) { Initialize(); // Load state types } public async Task SubmitForReview(ApprovalRequest request) { // Validate current state if (request.StateType.SortOrder != 0) throw new InvalidOperationException("Can only submit from Created state"); // Transition to "Under Review" (sortOrder = 10) return await UpdateStateAsync(request, 10); } public async Task Approve(ApprovalRequest request) { // Must be in review state if (request.StateType.SortOrder != 10) throw new InvalidOperationException("Can only approve from Under Review state"); // Use primary transition from current state var targetOrder = request.StateType.PrimaryTargetSortOrder; return await UpdateStateAsync(request, targetOrder); } public async Task Reject(ApprovalRequest request, string reason) { // Use secondary transition var targetOrder = request.StateType.SecondaryTargetSortOrder; var result = await UpdateStateAsync(request, targetOrder); if (result) { // Log rejection reason await LogRejection(request, reason); } return result; } } ``` ## Standard State Machine Conventions ### Sort Order Standards StateMachineEntityManager provides standard methods with conventional sort orders: * **0**: Created/Initial (SetCreatedAsync) * **1-97**: Custom intermediate states * **98**: Cancelled - Terminal state (SetCancelledAsync) * **99**: Failed - Terminal state with error (SetFailedAsync) * **100**: Completed - Success terminal state (SetCompletedAsync) ### Terminal States States with sort orders 98-100 are considered terminal: * No outgoing transitions * Workflow ends * May allow reset to initial state ## Advanced Patterns ### Dynamic State Validation ```csharp theme={"dark"} public bool CanTransitionTo(ApprovalState currentState, int targetSortOrder) { // Check primary transition if (currentState.PrimaryTargetSortOrder == targetSortOrder) return true; // Check secondary transition if (currentState.SecondaryTargetSortOrder == targetSortOrder) return true; // Check if going backwards is allowed (custom logic) if (targetSortOrder < currentState.SortOrder && AllowBackwardTransition) return true; return false; } ``` ### State History Tracking ```csharp theme={"dark"} public class StateHistory : DbObservableObject { public Guid Id { get; set; } public Guid EntityId { get; set; } public Guid FromStateId { get; set; } public Guid ToStateId { get; set; } public DateTimeOffset TransitionDate { get; set; } public Guid TransitionedById { get; set; } public string Notes { get; set; } } public override async Task UpdateStateAsync(TEntity entity, int sortOrder) { var fromState = entity.StateTypeId; var result = await base.UpdateStateAsync(entity, sortOrder); if (result) { // Record transition await DataContext.StateHistories.AddAsync(new StateHistory { EntityId = entity.Id, FromStateId = fromState, ToStateId = entity.StateTypeId, TransitionDate = DateTime.UtcNow, TransitionedById = ClaimsPrincipal.Current.GetIdClaim() }); } return result; } ``` ### Conditional Transitions ```csharp theme={"dark"} public async Task ProcessStateTransition(ApprovalRequest request) { var currentState = request.StateType; // Evaluate conditions for primary path if (await EvaluatePrimaryConditions(request)) { return await UpdateStateAsync(request, currentState.PrimaryTargetSortOrder); } // Fall back to secondary path return await UpdateStateAsync(request, currentState.SecondaryTargetSortOrder); } private async Task EvaluatePrimaryConditions(ApprovalRequest request) { // Business logic for transition conditions return request.Amount < 10000 && request.Priority != "High"; } ``` ### Parallel States ```csharp theme={"dark"} public interface IHasParallelStates where T : class, IDbStateEnum { Guid PrimaryStateTypeId { get; set; } T PrimaryStateType { get; set; } Guid SecondaryStateTypeId { get; set; } T SecondaryStateType { get; set; } } ``` ## UI Integration ### Display Current State ```csharp theme={"dark"} @if (Model.StateType != null) {

@Model.StateType.DisplayName

@Model.StateType.InstructionText

@if (!string.IsNullOrWhiteSpace(Model.StateType.PrimaryTargetDisplayText)) { } @if (!string.IsNullOrWhiteSpace(Model.StateType.SecondaryTargetDisplayText)) { }
} ``` ### State Visualization ```csharp theme={"dark"} public class StateVisualization { public List GetWorkflowDiagram() where T : class, IDbStateEnum { var states = DataContext.Set() .Where(s => s.IsActive) .OrderBy(s => s.SortOrder) .ToList(); return states.Select(s => new StateNode { Id = s.Id, Label = s.DisplayName, Position = s.SortOrder, PrimaryTarget = s.PrimaryTargetSortOrder, SecondaryTarget = s.SecondaryTargetSortOrder, IsTerminal = s.SortOrder >= 98 }).ToList(); } } ``` ## Best Practices 1. **Use SortOrder consistently**: Maintain gaps (0, 10, 20) for future states 2. **Keep transitions simple**: Avoid complex branching when possible 3. **Document state meanings**: Clear DisplayName and InstructionText 4. **Validate transitions**: Check business rules before state changes 5. **Track history**: Log all state transitions for audit 6. **Handle concurrency**: Use optimistic locking for state updates 7. **Cache state types**: Initialize() once, reuse cached values 8. **Test edge cases**: Terminal states, backwards transitions 9. **Provide clear UI**: Show available actions based on current state 10. **Plan for inactive states**: Design migration path for deprecated states # Table Design Patterns Source: https://easyaf.dev/guides/table-design Understanding EasyAF's opinionated database design structure through composable interfaces # Overview EasyAF enforces an opinionated database design structure that promotes consistency, maintainability, and reduces boilerplate code. By implementing a set of composable interfaces, your entities automatically gain common functionality that works seamlessly with Entity Framework Core and OData Restier. ## Core Concepts The EasyAF framework uses **interface composition** to build database entities with common patterns. Rather than inheriting from a base class, you implement specific interfaces that add the functionality you need. This approach provides flexibility while maintaining consistency across your data model. ### Benefits of the Interface-Based Approach * **Composability**: Mix and match interfaces to get exactly the functionality you need * **Consistency**: Common patterns across all tables * **Code Generation**: Automatic handling of audit fields, state management, and more * **Type Safety**: Generic interfaces ensure compile-time type checking * **OData Integration**: Seamless integration with OData queries and filters ## Naming Conventions and Design Principles EasyAF enforces specific naming conventions that enhance code generation, improve IntelliSense experiences, and create predictable patterns across your codebase. ### Primary Keys: Always "Id" Primary key properties are **always** named `Id`, never prefixed with the table name. ```csharp theme={"dark"} // Correct public class Product : IIdentifiable { public Guid Id { get; set; } } // Incorrect - Don't do this public class Product : IIdentifiable { public Guid ProductId { get; set; } } ``` **Why?** * **Serialization efficiency**: Shorter property names reduce payload size * **Predictability**: `Id` is always the primary key, `{TableName}Id` is always a foreign key * **Consistency**: Universal pattern across all entities ### Foreign Keys: Id Foreign key properties follow the pattern `{TableName}Id` to clearly indicate relationships. ```csharp theme={"dark"} public class OrderItem : IIdentifiable { public Guid Id { get; set; } // Foreign key relationships public Guid OrderId { get; set; } public Order Order { get; set; } public Guid ProductId { get; set; } public Product Product { get; set; } } ``` #### Exception: Semantic Naming for Clarity Use more descriptive names when the relationship role needs clarification: ```csharp theme={"dark"} // Self-referencing hierarchy public class Category : IIdentifiable { public Guid Id { get; set; } public Guid? ParentId { get; set; } // More clear than CategoryId public Category Parent { get; set; } } // Multiple relationships to the same entity public class Conversation : IIdentifiable { public Guid Id { get; set; } public Guid SenderId { get; set; } // More clear than UserId public User Sender { get; set; } public Guid RecipientId { get; set; } // More clear than UserId public User Recipient { get; set; } } // Audit tracking with semantic meaning public class Document : IIdentifiable, ICreatorTrackable, IUpdaterTrackable { public Guid Id { get; set; } // Semantic names clarify intent public Guid CreatedById { get; set; } // Better than UserId public Guid? UpdatedById { get; set; } // Clarifies which user action } ``` **Never create direct foreign keys to User tables in business entities.** This pollutes object models and creates unnecessary coupling. Use filtering in queries instead: ```csharp theme={"dark"} // Good: Filter in query var userOrders = await _context.Orders .Where(o => o.CreatedById == currentUser.Id) .ToListAsync(); // Bad: Direct foreign key public class Order { public Guid UserId { get; set; } // Don't do this public User User { get; set; } // Pollutes the model } ``` ### Date Properties: Prefix with "Date" All date/time properties should be prefixed with `Date` followed by the semantic meaning. ```csharp theme={"dark"} public class Subscription : IIdentifiable, ICreatedAuditable, IUpdatedAuditable { public Guid Id { get; set; } // Standard audit dates public DateTimeOffset DateCreated { get; set; } public DateTimeOffset? DateUpdated { get; set; } // Business dates public DateTimeOffset DateStarted { get; set; } public DateTimeOffset? DateExpired { get; set; } public DateTimeOffset? DateCancelled { get; set; } public DateTimeOffset? DateRenewed { get; set; } } ``` **Benefits:** * **Code generation**: Tools can easily identify and process date fields * **IntelliSense grouping**: All date properties appear together in autocomplete lists * **Consistency**: Predictable naming across the entire codebase * **Clarity**: Immediately clear what the property represents ### Boolean Properties: "Is" or "Has" Prefix Boolean properties must be prefixed with `Is` or `Has` to indicate state or possession, typically in present tense. ```csharp theme={"dark"} public class Feature : IIdentifiable, IActiveTrackable { public Guid Id { get; set; } // State indicators (Is) public bool IsActive { get; set; } public bool IsVisible { get; set; } public bool IsEnabled { get; set; } public bool IsDeleted { get; set; } public bool IsPremium { get; set; } // Possession indicators (Has) public bool HasOptions { get; set; } public bool HasChildren { get; set; } public bool HasExpired { get; set; } } ``` **Guidelines:** * Use `Is` for state: `IsActive`, `IsVisible`, `IsEnabled`, `IsPublished` * Use `Has` for possession or capability: `HasOptions`, `HasChildren`, `HasAccess` * Present tense preferred: `IsActive` over `WasActive` * Positive phrasing preferred: `IsVisible` over `IsHidden` (when practical) ### DisplayName: UI-Focused Property The `DisplayName` property (from `IHumanReadable`) is **always** the primary user-facing text representation of an entity. ```csharp theme={"dark"} public class Company : IIdentifiable, IHumanReadable { public Guid Id { get; set; } // Primary display value for UI public string DisplayName { get; set; } // "Acme Corporation" // Other name properties for specific purposes public string LegalName { get; set; } // "Acme Corporation, Inc." public string TradeName { get; set; } // "ACME" public string InternalCode { get; set; } // "ACME-001" } ``` **Rules:** * `DisplayName` is what appears in dropdowns, lists, and labels * Other "name" properties can exist for specific purposes (`LegalName`, `CompanyName`, etc.) * If showing users a single text value, use `DisplayName` ```csharp theme={"dark"} // In UI code ``` ### Database Enums and SortOrder The `SortOrder` property in `IDbEnum` serves a dual purpose: UI ordering and C# enum mapping. ```csharp theme={"dark"} public class Priority : IDbEnum { public Guid Id { get; set; } public string DisplayName { get; set; } public int SortOrder { get; set; } // Critical for enum mapping public bool IsActive { get; set; } } // C# enum for compile-time safety public enum PriorityEnum { Low = 1, Medium = 2, High = 3, Critical = 4 } // Mapping between C# enum and database public static class PriorityExtensions { public static PriorityEnum ToEnum(this Priority priority) { return (PriorityEnum)priority.SortOrder; } public static async Task ToDbEnum( this PriorityEnum enumValue, DbContext context) { return await context.Set() .FirstAsync(p => p.SortOrder == (int)enumValue); } } ``` **Benefits:** * Avoids complex EF Core enum mapping configuration * Maintains type safety in business logic via C# enums * Provides flexibility to change display text without code changes * Works reliably with OData (which has inconsistent enum support) ```csharp theme={"dark"} // Usage in business logic public async Task AssignPriority(Guid taskId) { var task = await _context.Tasks.FindAsync(taskId); // Use C# enum for logic if (task.IsUrgent) { var priority = await PriorityEnum.Critical.ToDbEnum(_context); task.PriorityId = priority.Id; } await _context.SaveChangesAsync(); } // Query by enum value var highPriorityTasks = await _context.Tasks .Include(t => t.Priority) .Where(t => t.Priority.SortOrder >= (int)PriorityEnum.High) .ToListAsync(); ``` Use `SortOrder` as the bridge between compile-time C# enums and runtime database enums. This gives you the best of both worlds: type safety in code and flexibility in data. ## Entity Identification ### IIdentifiable\ The foundation of every entity in EasyAF. This interface ensures your entity has a unique identifier. ```csharp theme={"dark"} public interface IIdentifiable where T : struct { T Id { get; set; } } ``` **Common Usage:** ```csharp theme={"dark"} // Guid-based identity (recommended) public class Product : IIdentifiable { public Guid Id { get; set; } public string Name { get; set; } } // Integer-based identity public class Category : IIdentifiable { public int Id { get; set; } public string Name { get; set; } } ``` EasyAF recommends using `Guid` as the identifier type for most entities to avoid identity conflicts in distributed systems and simplify data synchronization. ## Audit Tracking Track when entities are created and updated, and by whom. ### ICreatedAuditable Tracks when an entity was created. ```csharp theme={"dark"} public interface ICreatedAuditable { DateTimeOffset DateCreated { get; set; } } ``` ### IUpdatedAuditable Tracks when an entity was last updated. ```csharp theme={"dark"} public interface IUpdatedAuditable { DateTimeOffset? DateUpdated { get; set; } } ``` `DateUpdated` is nullable because it's only set after the first update, not on creation. ### ICreatorTrackable\ Tracks which user created the entity. ```csharp theme={"dark"} public interface ICreatorTrackable where T : struct { T CreatedById { get; set; } } ``` Make the `CreatedById` column `NOT NULL`: every record has a creator. If the column allows nulls, code generation skips this interface and reports warning **EASYAF005**. Assign built-in or seed data to a system user ID that has zero permissions. `T` can be `Guid` (the default), `int`, or `long`. ### IUpdaterTrackable\ Tracks which user last updated the entity. ```csharp theme={"dark"} public interface IUpdaterTrackable where T : struct { T? UpdatedById { get; set; } } ``` **Complete Audit Example:** ```csharp theme={"dark"} public class Order : IIdentifiable, ICreatedAuditable, IUpdatedAuditable, ICreatorTrackable, IUpdaterTrackable { public Guid Id { get; set; } public DateTimeOffset DateCreated { get; set; } public DateTimeOffset? DateUpdated { get; set; } public Guid CreatedById { get; set; } public Guid? UpdatedById { get; set; } // Business properties public string OrderNumber { get; set; } public decimal TotalAmount { get; set; } } ``` ## Active/Inactive Tracking ### IActiveTrackable Implements soft delete functionality by tracking whether an entity is active or inactive. ```csharp theme={"dark"} public interface IActiveTrackable { bool IsActive { get; set; } } ``` **Usage:** ```csharp theme={"dark"} public class Customer : IIdentifiable, IActiveTrackable { public Guid Id { get; set; } public bool IsActive { get; set; } public string Name { get; set; } public string Email { get; set; } } // In your repository/service public async Task DeactivateCustomer(Guid customerId) { var customer = await _context.Customers.FindAsync(customerId); customer.IsActive = false; // Soft delete await _context.SaveChangesAsync(); } ``` Use `IActiveTrackable` instead of hard deletes to maintain data integrity and enable historical reporting. ## User-Friendly Display ### IHumanReadable Provides a consistent property for displaying entity names to users. ```csharp theme={"dark"} public interface IHumanReadable { string DisplayName { get; set; } } ``` **Usage:** ```csharp theme={"dark"} public class ProductCategory : IIdentifiable, IHumanReadable { public Guid Id { get; set; } public string DisplayName { get; set; } public string InternalCode { get; set; } } // In your UI ``` ## Ordering and Sorting ### ISortable Enables manual ordering of entities in lists and dropdowns. ```csharp theme={"dark"} public interface ISortable { int SortOrder { get; set; } } ``` **Usage:** ```csharp theme={"dark"} public class MenuSection : IIdentifiable, IHumanReadable, ISortable { public Guid Id { get; set; } public string DisplayName { get; set; } public int SortOrder { get; set; } } // Query with ordering var sections = await _context.MenuSections .Where(s => s.IsActive) .OrderBy(s => s.SortOrder) .ToListAsync(); ``` ## Database-Driven Enumerations Traditional enums in code can cause problems when business logic changes. EasyAF provides a pattern for database-driven enumerations that can be updated without code changes. ### IDbEnum The base interface for all database enumerations. ```csharp theme={"dark"} public interface IDbEnum : IIdentifiable, IActiveTrackable, IHumanReadable, ISortable { } ``` `IDbEnum` combines multiple interfaces, giving you identity, active tracking, human-readable display, and sorting in one declaration. **Usage:** ```csharp theme={"dark"} public class Priority : IDbEnum { public Guid Id { get; set; } public bool IsActive { get; set; } public string DisplayName { get; set; } public int SortOrder { get; set; } } // Seeded data public class PrioritySeeder { public static List GetPriorities() { return new List { new Priority { Id = Guid.Parse("..."), DisplayName = "Low", SortOrder = 1, IsActive = true }, new Priority { Id = Guid.Parse("..."), DisplayName = "Medium", SortOrder = 2, IsActive = true }, new Priority { Id = Guid.Parse("..."), DisplayName = "High", SortOrder = 3, IsActive = true } }; } } ``` ### IDbStatusEnum Specialized enumeration for tracking entity status. ```csharp theme={"dark"} public interface IDbStatusEnum : IDbEnum { } ``` **Usage:** ```csharp theme={"dark"} public class OrderStatus : IDbStatusEnum { public Guid Id { get; set; } public bool IsActive { get; set; } public string DisplayName { get; set; } public int SortOrder { get; set; } } // Seeded statuses: Draft, Pending, Approved, Rejected, etc. ``` ### IDbStateEnum Advanced enumeration for state machine workflows, providing navigation between states. ```csharp theme={"dark"} public interface IDbStateEnum : IDbEnum { string InstructionText { get; set; } string PrimaryTargetDisplayText { get; set; } int PrimaryTargetSortOrder { get; set; } string SecondaryTargetDisplayText { get; set; } int SecondaryTargetSortOrder { get; set; } } ``` **Usage:** ```csharp theme={"dark"} public class ApprovalState : IDbStateEnum { public Guid Id { get; set; } public bool IsActive { get; set; } public string DisplayName { get; set; } public int SortOrder { get; set; } // State machine properties public string InstructionText { get; set; } public string PrimaryTargetDisplayText { get; set; } public int PrimaryTargetSortOrder { get; set; } public string SecondaryTargetDisplayText { get; set; } public int SecondaryTargetSortOrder { get; set; } } // Example state: "Pending Review" // InstructionText: "This request is awaiting manager approval" // PrimaryTargetDisplayText: "Approve" // PrimaryTargetSortOrder: 3 (points to "Approved" state) // SecondaryTargetDisplayText: "Reject" // SecondaryTargetSortOrder: 4 (points to "Rejected" state) ``` ## Linking Entities to Enumerations ### IHasStatus\ Links an entity to a status enumeration. ```csharp theme={"dark"} public interface IHasStatus : IIdentifiable where T : class, IDbStatusEnum { T StatusType { get; set; } Guid StatusTypeId { get; set; } } ``` **Usage:** ```csharp theme={"dark"} public class PurchaseOrder : IIdentifiable, IHasStatus { public Guid Id { get; set; } public string OrderNumber { get; set; } // Status relationship public Guid StatusTypeId { get; set; } public OrderStatus StatusType { get; set; } } // Query with status var pendingOrders = await _context.PurchaseOrders .Include(o => o.StatusType) .Where(o => o.StatusType.DisplayName == "Pending") .ToListAsync(); ``` ### IHasState\ Links an entity to a state enumeration for workflow management. ```csharp theme={"dark"} public interface IHasState : IIdentifiable where T : class, IDbStateEnum { T StateType { get; set; } Guid StateTypeId { get; set; } } ``` **Usage:** ```csharp theme={"dark"} public class ExpenseReport : IIdentifiable, IHasState { public Guid Id { get; set; } public decimal Amount { get; set; } // State relationship public Guid StateTypeId { get; set; } public ApprovalState StateType { get; set; } } // State machine logic public async Task AdvanceToNextState(Guid expenseReportId, bool usePrimary = true) { var report = await _context.ExpenseReports .Include(r => r.StateType) .FirstAsync(r => r.Id == expenseReportId); var nextSortOrder = usePrimary ? report.StateType.PrimaryTargetSortOrder : report.StateType.SecondaryTargetSortOrder; var nextState = await _context.ApprovalStates .FirstAsync(s => s.SortOrder == nextSortOrder); report.StateTypeId = nextState.Id; await _context.SaveChangesAsync(); } ``` ## Complete Entity Example Here's a comprehensive example combining multiple interfaces: ```csharp theme={"dark"} public class Employee : IIdentifiable, ICreatedAuditable, IUpdatedAuditable, ICreatorTrackable, IUpdaterTrackable, IActiveTrackable, IHumanReadable, IHasStatus { // IIdentifiable public Guid Id { get; set; } // Audit tracking public DateTimeOffset DateCreated { get; set; } public DateTimeOffset? DateUpdated { get; set; } public Guid CreatedById { get; set; } public Guid? UpdatedById { get; set; } // Active tracking public bool IsActive { get; set; } // Human readable public string DisplayName { get; set; } // Status relationship public Guid StatusTypeId { get; set; } public EmploymentStatus StatusType { get; set; } // Business properties public string Email { get; set; } public string Department { get; set; } public DateTimeOffset HireDate { get; set; } } ``` ## Best Practices ### 1. Start with the Basics Always implement `IIdentifiable` as your foundation: ```csharp theme={"dark"} public class MyEntity : IIdentifiable { public Guid Id { get; set; } // Add more interfaces as needed } ``` ### 2. Add Audit Tracking for Business Entities For entities that track business operations, implement full audit tracking: ```csharp theme={"dark"} public class Invoice : IIdentifiable, ICreatedAuditable, ICreatorTrackable, IUpdatedAuditable, IUpdaterTrackable { // Interface implementations... } ``` ### 3. Use Soft Deletes Prefer `IActiveTrackable` over hard deletes: ```csharp theme={"dark"} // Good: Soft delete customer.IsActive = false; // Avoid: Hard delete _context.Customers.Remove(customer); ``` ### 4. Leverage Database Enumerations Replace code enums with database enumerations for flexibility: ```csharp theme={"dark"} // Instead of this: public enum OrderStatus { Draft, Pending, Approved } // Use this: public class OrderStatus : IDbStatusEnum { /* ... */ } ``` ### 5. Consistent Interface Ordering Use a consistent order when implementing multiple interfaces for better readability: 1. `IIdentifiable` 2. Audit interfaces (`ICreatedAuditable`, etc.) 3. `IActiveTrackable` 4. `IHumanReadable` 5. `ISortable` 6. Status/State interfaces 7. Custom interfaces ## Integration with Entity Framework Core Configure your DbContext to respect these interfaces: ```csharp theme={"dark"} public class ApplicationDbContext : DbContext { public DbSet Employees { get; set; } public DbSet EmploymentStatuses { get; set; } public override Task SaveChangesAsync( CancellationToken cancellationToken = default) { // Auto-set audit fields var entries = ChangeTracker.Entries() .Where(e => e.State == EntityState.Added || e.State == EntityState.Modified); foreach (var entry in entries) { if (entry.Entity is IUpdatedAuditable updatable) { updatable.DateUpdated = DateTimeOffset.UtcNow; } if (entry.State == EntityState.Added && entry.Entity is ICreatedAuditable creatable) { creatable.DateCreated = DateTimeOffset.UtcNow; } } return base.SaveChangesAsync(cancellationToken); } } ``` ## Summary EasyAF's interface-based table design provides: * **Consistency**: Common patterns across all entities * **Flexibility**: Compose interfaces to match your needs * **Maintainability**: Centralized definitions reduce duplication * **Integration**: Seamless OData and EF Core support * **Scalability**: Database-driven enumerations adapt to changing business requirements By following these patterns, you'll create a robust, maintainable data model that works seamlessly with the EasyAF framework and reduces boilerplate throughout your application. # EasyAF - The Application Framework That's Easy As F*ck! Source: https://easyaf.dev/index Build Secure, Scalable .NET Applications Faster # IApplicationBuilder Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/AspNetCore/Builder/IApplicationBuilder Extension methods for IApplicationBuilder from Microsoft.AspNetCore.Http.Abstractions ## Definition **Assembly:** Microsoft.AspNetCore.Http.Abstractions.dll **Namespace:** Microsoft.AspNetCore.Builder ## Syntax ```csharp theme={"dark"} Microsoft.AspNetCore.Builder.IApplicationBuilder ``` ## Summary This type is defined in Microsoft.AspNetCore.Http.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder) for more information about the rest of the API. ## Methods ### UseODataMcp Extension method from `Microsoft.AspNetCore.Builder.ODataMcp_AspNetCore_ApplicationBuilderExtensions` Adds OData MCP middleware to automatically discover and register MCP endpoints. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseODataMcp(Microsoft.AspNetCore.Builder.IApplicationBuilder app) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `Microsoft.AspNetCore.Builder.IApplicationBuilder` | The application builder. | #### Returns Type: `Microsoft.AspNetCore.Builder.IApplicationBuilder` The application builder for chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *app* is null. | #### Examples ```csharp theme={"dark"} var app = builder.Build(); app.UseRouting(); app.UseODataMcp(); // Automatic MCP endpoint registration app.MapControllers(); ``` #### Remarks This method must be called after UseRouting() but before UseEndpoints() or MapControllers(). It automatically discovers all registered OData routes and adds corresponding MCP endpoints. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/AspNetCore/Builder/index Summary of the Microsoft.AspNetCore.Builder Namespace ## Types # IEndpointRouteBuilder Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/AspNetCore/Routing/IEndpointRouteBuilder Extension methods for IEndpointRouteBuilder from Microsoft.AspNetCore.Routing ## Definition **Assembly:** Microsoft.AspNetCore.Routing.dll **Namespace:** Microsoft.AspNetCore.Routing ## Syntax ```csharp theme={"dark"} Microsoft.AspNetCore.Routing.IEndpointRouteBuilder ``` ## Summary This type is defined in Microsoft.AspNetCore.Routing. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.routing.iendpointroutebuilder) for more information about the rest of the API. ## Methods ### AddMcpForODataRoute Extension method from `Microsoft.AspNetCore.Routing.ODataMcp_AspNetCore_RouteBuilderExtensions` Adds MCP endpoints to an endpoint route builder for a specific OData route. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Routing.IEndpointRouteBuilder AddMcpForODataRoute(Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpointRouteBuilder, string routeName, string routePrefix, string customMcpPath = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `endpointRouteBuilder` | `Microsoft.AspNetCore.Routing.IEndpointRouteBuilder` | The endpoint route builder. | | `routeName` | `string` | The OData route name. | | `routePrefix` | `string` | The OData route prefix. | | `customMcpPath` | `string?` | Optional custom MCP path. | #### Returns Type: `Microsoft.AspNetCore.Routing.IEndpointRouteBuilder` The endpoint route builder for chaining. # IRouteBuilder Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/AspNetCore/Routing/IRouteBuilder Extension methods for IRouteBuilder from Microsoft.AspNetCore.Routing ## Definition **Assembly:** Microsoft.AspNetCore.Routing.dll **Namespace:** Microsoft.AspNetCore.Routing ## Syntax ```csharp theme={"dark"} Microsoft.AspNetCore.Routing.IRouteBuilder ``` ## Summary This type is defined in Microsoft.AspNetCore.Routing. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.routing.iroutebuilder) for more information about the rest of the API. ## Methods ### AddMcp Extension method from `Microsoft.AspNetCore.Routing.ODataMcp_AspNetCore_RouteBuilderExtensions` Adds MCP endpoints to an OData route using the default path. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Routing.IRouteBuilder AddMcp(Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `routeBuilder` | `Microsoft.AspNetCore.Routing.IRouteBuilder` | The route builder. | #### Returns Type: `Microsoft.AspNetCore.Routing.IRouteBuilder` The route builder for chaining. #### Examples ```csharp theme={"dark"} endpoints.MapODataRoute("odata", "api/v1", GetEdmModel()) .AddMcp(); ``` #### Remarks This method adds MCP endpoints as siblings to the OData \$metadata endpoint. For example, if the OData route is "api/v1", the MCP endpoints will be at "api/v1/mcp". ### AddMcp Extension method from `Microsoft.AspNetCore.Routing.ODataMcp_AspNetCore_RouteBuilderExtensions` Adds MCP endpoints to an OData route using a custom path. #### Syntax ```csharp theme={"dark"} public static Microsoft.AspNetCore.Routing.IRouteBuilder AddMcp(Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string customPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `routeBuilder` | `Microsoft.AspNetCore.Routing.IRouteBuilder` | The route builder. | | `customPath` | `string?` | The custom MCP path, or null to use the default. | #### Returns Type: `Microsoft.AspNetCore.Routing.IRouteBuilder` The route builder for chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *routeBuilder* is null. | #### Examples ```csharp theme={"dark"} endpoints.MapODataRoute("odata", "api/v1", GetEdmModel()) .AddMcp("/custom/mcp/path"); ``` # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/AspNetCore/Routing/index Summary of the Microsoft.AspNetCore.Routing Namespace ## Types # IMcpServerBuilder Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/Extensions/DependencyInjection/IMcpServerBuilder Extension methods for IMcpServerBuilder from ModelContextProtocol ## Definition **Assembly:** ModelContextProtocol.dll **Namespace:** Microsoft.Extensions.DependencyInjection ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.DependencyInjection.IMcpServerBuilder ``` ## Summary This type is defined in ModelContextProtocol. ## Methods ### WithODataTools Extension method from `Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions` Configures the OData MCP Server to use the official MCP SDK. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IMcpServerBuilder WithODataTools(Microsoft.Extensions.DependencyInjection.IMcpServerBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.DependencyInjection.IMcpServerBuilder` | The MCP server builder. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IMcpServerBuilder` The MCP server builder for chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *builder* is null. | #### Examples ```csharp theme={"dark"} services.AddMcpServer() .WithODataTools() .WithStdioTransport(); ``` #### Remarks Registers all OData tools from the Core assembly with the MCP server builder. This method is used when integrating with the official ModelContextProtocol SDK. # IServiceCollection Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection Extension methods for IServiceCollection from Microsoft.Extensions.DependencyInjection.Abstractions ## Definition **Assembly:** Microsoft.Extensions.DependencyInjection.Abstractions.dll **Namespace:** Microsoft.Extensions.DependencyInjection ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.DependencyInjection.IServiceCollection ``` ## Summary This type is defined in Microsoft.Extensions.DependencyInjection.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) for more information about the rest of the API. ## Methods ### AddODataHttpClient Extension method from `Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions` Adds a configured HTTP client for OData service communication. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddODataHttpClient(Microsoft.Extensions.DependencyInjection.IServiceCollection services) ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for chaining. #### Examples ```csharp theme={"dark"} services.AddODataHttpClient(); ``` #### Remarks Registers a named HTTP client "OData" configured with standard OData headers and authentication. This method is called automatically by AddODataMcpCore but can be used independently if needed. ### AddODataHttpClient Extension method from `Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions` Adds a configured HTTP client for OData service communication with a custom name. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddODataHttpClient(Microsoft.Extensions.DependencyInjection.IServiceCollection services, string clientName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection. | | `clientName` | `string` | The name for the HTTP client. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *services* is null. | | `ArgumentException` | Thrown when *clientName* is null or whitespace. | #### Examples ```csharp theme={"dark"} // Register multiple OData clients for different services services.AddODataHttpClient("NorthwindClient"); services.AddODataHttpClient("AdventureWorksClient"); // Use the named client var client = httpClientFactory.CreateClient("NorthwindClient"); ``` #### Remarks Registers a named HTTP client configured for OData communication. The client is configured with: * Standard OData headers (Accept, OData-Version, OData-MaxVersion) * Base URL from configuration * Authentication headers based on configuration (Bearer, API Key, or Basic) * Timeout settings from configuration ### AddODataMcp Extension method from `Microsoft.Extensions.DependencyInjection.ODataMcp_AspNetCore_ServiceCollectionExtensions` Adds OData MCP automatic routing services to the service collection. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddODataMcp(Microsoft.Extensions.DependencyInjection.IServiceCollection services) ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for chaining. #### Examples ```csharp theme={"dark"} builder.Services.AddControllers() .AddOData(options => options .AddRouteComponents("api/v1", GetV1Model()) .AddRouteComponents("api/v2", GetV2Model())); builder.Services.AddODataMcp(); // Automatically enables MCP for all routes ``` ### AddODataMcp Extension method from `Microsoft.Extensions.DependencyInjection.ODataMcp_AspNetCore_ServiceCollectionExtensions` Adds OData MCP automatic routing services to the service collection with configuration. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddODataMcp(Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configureOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection. | | `configureOptions` | `System.Action` | The options configuration delegate. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *services* or *configureOptions* is null. | #### Examples ```csharp theme={"dark"} builder.Services.AddODataMcp(options => { options.AutoRegisterRoutes = true; options.ExcludeRoutes = new[] { "internal", "legacy" }; options.EnableDynamicModels = false; }); ``` ### AddODataMcpCore Extension method from `Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions` Adds core OData MCP Server services to the service collection. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddODataMcpCore(Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration) ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection. | | `configuration` | `Microsoft.Extensions.Configuration.IConfiguration` | The configuration root. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *services* or *configuration* is null. | #### Examples ```csharp theme={"dark"} var builder = WebApplication.CreateBuilder(args); builder.Services.AddODataMcpCore(builder.Configuration); ``` #### Remarks Registers all core services required for OData MCP functionality, including parsers, tool generators, and HTTP clients. Configuration is loaded from the "McpServer" section of the provided IConfiguration. ### AddODataMcpCore Extension method from `Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions` Adds OData MCP Server with custom configuration. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddODataMcpCore(Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action configureOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The service collection. | | `configureOptions` | `System.Action` | Action to configure server options. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The service collection for chaining. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *services* or *configureOptions* is null. | #### Examples ```csharp theme={"dark"} services.AddODataMcpCore(config => { config.ODataService.BaseUrl = Environment.GetEnvironmentVariable("ODATA_URL"); config.ODataService.RequestTimeout = TimeSpan.FromMinutes(5); config.Caching.Enabled = true; }); ``` #### Remarks Registers all core services required for OData MCP functionality with programmatic configuration. This overload is useful when configuration needs to be built dynamically or when not using IConfiguration. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/Extensions/DependencyInjection/index Summary of the Microsoft.Extensions.DependencyInjection Namespace ## Types # AspNetCoreJsonConstants Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Constants/AspNetCoreJsonConstants Provides centralized JsonSerializerOptions instances specific to ASP.NET Core scenarios. ## Definition **Assembly:** Microsoft.OData.Mcp.AspNetCore.dll **Namespace:** Microsoft.OData.Mcp.AspNetCore.Constants **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.AspNetCore.Constants.AspNetCoreJsonConstants ``` ## Summary Provides centralized JsonSerializerOptions instances specific to ASP.NET Core scenarios. ## Remarks These options extend the core JsonConstants with ASP.NET Core specific configurations. All instances are thread-safe and designed for reuse to minimize memory allocations. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Constants/index Summary of the Microsoft.OData.Mcp.AspNetCore.Constants Namespace ## Types ### Classes | Name | Summary | | - | - | | [AspNetCoreJsonConstants](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Constants/AspNetCoreJsonConstants) | Provides centralized JsonSerializerOptions instances specific to ASP.NET Core scenarios. | # AuthenticationHealthCheck Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/HealthChecks/AuthenticationHealthCheck Health check for the authentication system. ## Definition **Assembly:** Microsoft.OData.Mcp.AspNetCore.dll **Namespace:** Microsoft.OData.Mcp.AspNetCore.HealthChecks **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.AspNetCore.HealthChecks.AuthenticationHealthCheck ``` ## Summary Health check for the authentication system. ## Remarks This health check verifies that the authentication components are functioning correctly, including token validation services, authority connectivity, and configuration validity. ## Constructors ### .ctor Initializes a new instance of the [AuthenticationHealthCheck](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/HealthChecks/AuthenticationHealthCheck) class. #### Syntax ```csharp theme={"dark"} public AuthenticationHealthCheck(Microsoft.Extensions.Options.IOptions authOptions, Microsoft.Extensions.Logging.ILogger logger, Microsoft.OData.Mcp.Authentication.Services.ITokenValidationService tokenValidationService = null, System.Net.Http.IHttpClientFactory httpClientFactory = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `authOptions` | `Microsoft.Extensions.Options.IOptions` | The authentication options. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | | `tokenValidationService` | `Microsoft.OData.Mcp.Authentication.Services.ITokenValidationService?` | The token validation service (optional). | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory?` | The HTTP client factory (optional). | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *authOptions* or *logger* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### CheckHealthAsync Checks the health of the authentication system. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext` | The health check context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous health check operation. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck # McpServerHealthCheck Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/HealthChecks/McpServerHealthCheck Health check for the MCP server functionality. ## Definition **Assembly:** Microsoft.OData.Mcp.AspNetCore.dll **Namespace:** Microsoft.OData.Mcp.AspNetCore.HealthChecks **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.AspNetCore.HealthChecks.McpServerHealthCheck ``` ## Summary Health check for the MCP server functionality. ## Remarks This health check verifies that the core MCP server components are functioning correctly, including metadata parsing, tool registration, and basic connectivity. ## Constructors ### .ctor Initializes a new instance of the [McpServerHealthCheck](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/HealthChecks/McpServerHealthCheck) class. #### Syntax ```csharp theme={"dark"} public McpServerHealthCheck(Microsoft.Extensions.Logging.ILogger logger, Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory toolFactory = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | | `toolFactory` | `Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory?` | The MCP tool factory (optional). | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *logger* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### CheckHealthAsync Checks the health of the MCP server. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext` | The health check context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous health check operation. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/HealthChecks/index Summary of the Microsoft.OData.Mcp.AspNetCore.HealthChecks Namespace ## Types ### Classes | Name | Summary | | - | - | | [AuthenticationHealthCheck](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/HealthChecks/AuthenticationHealthCheck) | Health check for the authentication system. | | [McpServerHealthCheck](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/HealthChecks/McpServerHealthCheck) | Health check for the MCP server functionality. | # ODataMcpMiddleware Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Middleware/ODataMcpMiddleware Middleware that handles MCP requests for OData routes. ## Definition **Assembly:** Microsoft.OData.Mcp.AspNetCore.dll **Namespace:** Microsoft.OData.Mcp.AspNetCore.Middleware **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.AspNetCore.Middleware.ODataMcpMiddleware ``` ## Summary Middleware that handles MCP requests for OData routes. ## Constructors ### .ctor Initializes a new instance of the [ODataMcpMiddleware](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Middleware/ODataMcpMiddleware) class. #### Syntax ```csharp theme={"dark"} public ODataMcpMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Logging.ILogger logger, Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry endpointRegistry, Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory toolFactory, Microsoft.OData.Mcp.Core.ODataMcpOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `next` | `Microsoft.AspNetCore.Http.RequestDelegate` | The next middleware in the pipeline. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger. | | `endpointRegistry` | `Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry` | The MCP endpoint registry. | | `toolFactory` | `Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory` | The tool factory. | | `options` | `Microsoft.OData.Mcp.Core.ODataMcpOptions` | The MCP options. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### InvokeAsync Invokes the middleware. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.AspNetCore.Http.HttpContext` | The HTTP context. | #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Middleware/index Summary of the Microsoft.OData.Mcp.AspNetCore.Middleware Namespace ## Types ### Classes | Name | Summary | | - | - | | [ODataMcpMiddleware](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Middleware/ODataMcpMiddleware) | Middleware that handles MCP requests for OData routes. | # IMcpRouteConvention Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/IMcpRouteConvention Defines a contract for applying MCP conventions to OData routes. ## Definition **Assembly:** Microsoft.OData.Mcp.AspNetCore.dll **Namespace:** Microsoft.OData.Mcp.AspNetCore.Routing ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.AspNetCore.Routing.IMcpRouteConvention ``` ## Summary Defines a contract for applying MCP conventions to OData routes. ## Methods ### ApplyConvention Applies MCP conventions to the endpoint route builder. #### Syntax ```csharp theme={"dark"} void ApplyConvention(Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpointRouteBuilder, string routePrefix, string routeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `endpointRouteBuilder` | `Microsoft.AspNetCore.Routing.IEndpointRouteBuilder` | The endpoint route builder. | | `routePrefix` | `string` | The OData route prefix. | | `routeName` | `string` | The OData route name. | # McpEndpointMetadata Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/McpEndpointMetadata Metadata for MCP endpoints. ## Definition **Assembly:** Microsoft.OData.Mcp.AspNetCore.dll **Namespace:** Microsoft.OData.Mcp.AspNetCore.Routing **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.AspNetCore.Routing.McpEndpointMetadata ``` ## Summary Metadata for MCP endpoints. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public McpEndpointMetadata() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Command Gets or sets the MCP command type. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Routing.McpCommand Command { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Routing.McpCommand?` ### RouteName Gets or sets the OData route name. #### Syntax ```csharp theme={"dark"} public string RouteName { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataMcpRouteConvention Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/ODataMcpRouteConvention Automatically adds MCP endpoints to OData routes during registration. ## Definition **Assembly:** Microsoft.OData.Mcp.AspNetCore.dll **Namespace:** Microsoft.OData.Mcp.AspNetCore.Routing **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.AspNetCore.Routing.ODataMcpRouteConvention ``` ## Summary Automatically adds MCP endpoints to OData routes during registration. ## Remarks This convention ensures that for each OData route registered, corresponding MCP endpoints are automatically created as siblings to the \$metadata endpoint. ## Constructors ### .ctor Initializes a new instance of the [ODataMcpRouteConvention](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/ODataMcpRouteConvention) class. #### Syntax ```csharp theme={"dark"} public ODataMcpRouteConvention(Microsoft.Extensions.Options.IOptions options, Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry endpointRegistry) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `Microsoft.Extensions.Options.IOptions` | The MCP options. | | `endpointRegistry` | `Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry` | The MCP endpoint registry. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when required parameters are null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### ApplyConvention Applies MCP conventions to the endpoint route builder. #### Syntax ```csharp theme={"dark"} public void ApplyConvention(Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpointRouteBuilder, string routePrefix, string routeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `endpointRouteBuilder` | `Microsoft.AspNetCore.Routing.IEndpointRouteBuilder` | The endpoint route builder. | | `routePrefix` | `string` | The OData route prefix. | | `routeName` | `string` | The OData route name. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.OData.Mcp.AspNetCore.Routing.IMcpRouteConvention # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/index Summary of the Microsoft.OData.Mcp.AspNetCore.Routing Namespace ## Types ### Classes | Name | Summary | | - | - | | [McpEndpointMetadata](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/McpEndpointMetadata) | Metadata for MCP endpoints. | | [ODataMcpRouteConvention](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/ODataMcpRouteConvention) | Automatically adds MCP endpoints to OData routes during registration. | ### Interfaces | Name | Summary | | - | - | | [IMcpRouteConvention](/odata-mcp/api-reference/Microsoft/OData/Mcp/AspNetCore/Routing/IMcpRouteConvention) | Defines a contract for applying MCP conventions to OData routes. | # AuthorizationMetadata Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/AuthorizationMetadata Represents authorization metadata extracted from a JWT token for use in downstream services. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.AuthorizationMetadata ``` ## Summary Represents authorization metadata extracted from a JWT token for use in downstream services. ## Remarks This class contains the authorization information needed to make decisions about what operations a user can perform and what data they can access. It's designed to be lightweight and serializable for caching and delegation scenarios. ## Constructors ### .ctor Initializes a new instance of the [AuthorizationMetadata](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/AuthorizationMetadata) class. #### Syntax ```csharp theme={"dark"} public AuthorizationMetadata() ``` ### .ctor Initializes a new instance of the [AuthorizationMetadata](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/AuthorizationMetadata) class with the specified subject. #### Syntax ```csharp theme={"dark"} public AuthorizationMetadata(string subject) ``` #### Parameters | Name | Type | Description | | - | - | - | | `subject` | `string` | The user's subject identifier. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *subject* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Audience Gets or sets the token audience. #### Syntax ```csharp theme={"dark"} public string Audience { get; set; } ``` #### Property Value Type: `string?` The audience identifier from the JWT token. #### Remarks This identifies the intended recipient of the token and should match the service's expected audience value. ### ClientId Gets or sets the client application identifier. #### Syntax ```csharp theme={"dark"} public string ClientId { get; set; } ``` #### Property Value Type: `string?` The identifier of the client application. #### Remarks This identifies which application the user is accessing the system through, which can affect authorization decisions and audit trails. ### ContextId Gets or sets the authorization context identifier. #### Syntax ```csharp theme={"dark"} public string ContextId { get; set; } ``` #### Property Value Type: `string?` A unique identifier for this authorization context. #### Remarks This can be used to correlate authorization decisions across multiple services and audit logs. ### CustomAttributes Gets or sets custom authorization attributes. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomAttributes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom attributes that affect authorization decisions. #### Remarks These attributes can contain business-specific authorization data such as department, cost center, or data classification levels. ### ExpiresAt Gets or sets the token expiration time. #### Syntax ```csharp theme={"dark"} public System.Nullable ExpiresAt { get; set; } ``` #### Property Value Type: `System.Nullable` The UTC date and time when the token expires. #### Remarks This is used to determine if the authorization is still valid and when refresh might be needed. ### IssuedAt Gets or sets the token issued time. #### Syntax ```csharp theme={"dark"} public System.Nullable IssuedAt { get; set; } ``` #### Property Value Type: `System.Nullable` The UTC date and time when the token was issued. #### Remarks This timestamp can be used for auditing and determining the age of the authorization grant. ### Issuer Gets or sets the token issuer. #### Syntax ```csharp theme={"dark"} public string Issuer { get; set; } ``` #### Property Value Type: `string?` The issuer identifier from the JWT token. #### Remarks This identifies which authorization server issued the token, which is important for trust and validation decisions. ### Roles Gets or sets the user's roles. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Roles { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of roles assigned to the user. #### Remarks Roles provide a higher-level abstraction over permissions and can be used for role-based access control (RBAC) scenarios. ### Scopes Gets or sets the OAuth2 scopes granted to the user. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Scopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes that define the user's permissions. #### Remarks These scopes determine what operations the user is authorized to perform. They are used for fine-grained authorization decisions throughout the system. ### SessionId Gets or sets the session identifier. #### Syntax ```csharp theme={"dark"} public string SessionId { get; set; } ``` #### Property Value Type: `string?` The identifier of the user's authentication session. #### Remarks This links the authorization to a specific user session and can be used for session management and security monitoring. ### Subject Gets or sets the user's unique identifier. #### Syntax ```csharp theme={"dark"} public required string Subject { get; set; } ``` #### Property Value Type: `string` The subject identifier from the JWT token. #### Remarks This uniquely identifies the user across all systems and is used for auditing, logging, and data access control. ### TenantId Gets or sets the tenant identifier for multi-tenant scenarios. #### Syntax ```csharp theme={"dark"} public string TenantId { get; set; } ``` #### Property Value Type: `string?` The identifier of the tenant the user belongs to. #### Remarks This is used to isolate data and operations between different organizational units or customers in multi-tenant deployments. ## Methods ### Clone Creates a copy of the authorization metadata. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.AuthorizationMetadata Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.AuthorizationMetadata` A new instance with the same values as the current instance. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FromUserContext Creates authorization metadata from a user context. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Authentication.Models.AuthorizationMetadata FromUserContext(Microsoft.OData.Mcp.Authentication.Models.UserContext userContext) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userContext` | `Microsoft.OData.Mcp.Authentication.Models.UserContext` | The user context to extract metadata from. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.AuthorizationMetadata` Authorization metadata populated with information from the user context. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *userContext* is null. | ### GetCustomAttribute Gets a custom attribute value by key. #### Syntax ```csharp theme={"dark"} public string GetCustomAttribute(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The attribute key. | #### Returns Type: `string?` The attribute value if found; otherwise, null. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetRemainingLifetime Gets the remaining time before the authorization expires. #### Syntax ```csharp theme={"dark"} public System.Nullable GetRemainingLifetime() ``` #### Returns Type: `System.Nullable` The remaining time before expiration, or null if no expiration is set. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasAllScopes Determines whether the authorization has all of the specified scopes. #### Syntax ```csharp theme={"dark"} public bool HasAllScopes(System.Collections.Generic.IEnumerable requiredScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `requiredScopes` | `System.Collections.Generic.IEnumerable` | The scopes to check for. | #### Returns Type: `bool` `true` if all required scopes are present; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *requiredScopes* is null. | ### HasAnyRole Determines whether the authorization has any of the specified roles. #### Syntax ```csharp theme={"dark"} public bool HasAnyRole(System.Collections.Generic.IEnumerable requiredRoles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `requiredRoles` | `System.Collections.Generic.IEnumerable` | The roles to check for. | #### Returns Type: `bool` `true` if any of the required roles are present; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *requiredRoles* is null. | ### HasAnyScope Determines whether the authorization has any of the specified scopes. #### Syntax ```csharp theme={"dark"} public bool HasAnyScope(System.Collections.Generic.IEnumerable requiredScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `requiredScopes` | `System.Collections.Generic.IEnumerable` | The scopes to check for. | #### Returns Type: `bool` `true` if any of the required scopes are present; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *requiredScopes* is null. | ### IsExpired Determines whether the authorization is expired. #### Syntax ```csharp theme={"dark"} public bool IsExpired() ``` #### Returns Type: `bool` `true` if the authorization is expired; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetCustomAttribute Adds or updates a custom attribute. #### Syntax ```csharp theme={"dark"} public void SetCustomAttribute(string key, string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The attribute key. | | `value` | `string` | The attribute value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### ToString Returns a string representation of the authorization metadata. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the authorization metadata. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # BackoffStrategy Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/BackoffStrategy Defines the backoff strategies for retry delays. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.BackoffStrategy ``` ## Summary Defines the backoff strategies for retry delays. ## Values | Name | Value | Description | | - | - | - | | `Fixed` | 0 | Use a fixed delay between all retry attempts. | | `Linear` | 1 | Increase delay linearly with each retry attempt. | | `Exponential` | 2 | Increase delay exponentially with each retry attempt. | | `ExponentialWithJitter` | 3 | Use exponential backoff with random jitter to prevent thundering herd. | # CertificateSource Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/CertificateSource Defines the sources from which client certificates can be loaded. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.CertificateSource ``` ## Summary Defines the sources from which client certificates can be loaded. ## Values | Name | Value | Description | | - | - | - | | `Store` | 0 | Load certificate from the Windows certificate store. | | `File` | 1 | Load certificate from a file on disk. | | `Base64` | 2 | Load certificate from Base64-encoded data in configuration. | # ClientAuthenticationMethod Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientAuthenticationMethod Defines the client authentication methods supported by OAuth2. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.ClientAuthenticationMethod ``` ## Summary Defines the client authentication methods supported by OAuth2. ## Values | Name | Value | Description | | - | - | - | | `None` | 0 | No client authentication (public client). | | `ClientSecret` | 1 | Client secret sent in the Authorization header using HTTP Basic authentication. | | `ClientSecretPost` | 2 | Client secret sent in the request body as a form parameter. | | `TlsClientAuth` | 3 | Client authentication using TLS client certificates. | | `SelfSignedTlsClientAuth` | 4 | Client authentication using self-signed TLS client certificates. | | `PrivateKeyJwt` | 5 | Client authentication using JWT signed with the client's internal key. | | `ClientSecretJwt` | 6 | Client authentication using JWT signed with the client secret. | # ClientCertificate Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCertificate Configuration for client certificate authentication. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.ClientCertificate ``` ## Summary Configuration for client certificate authentication. ## Remarks Client certificates provide a secure method for authenticating the MCP server to authorization servers and downstream services. They offer better security than client secrets and support automatic rotation. ## Constructors ### .ctor Initializes a new instance of the [ClientCertificate](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCertificate) class. #### Syntax ```csharp theme={"dark"} public ClientCertificate() ``` ### .ctor Initializes a new instance of the [ClientCertificate](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCertificate) class for store-based lookup by thumbprint. #### Syntax ```csharp theme={"dark"} public ClientCertificate(string thumbprint, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation = 1, System.Security.Cryptography.X509Certificates.StoreName storeName = 5) ``` #### Parameters | Name | Type | Description | | - | - | - | | `thumbprint` | `string` | The certificate thumbprint. | | `storeLocation` | `System.Security.Cryptography.X509Certificates.StoreLocation` | The certificate store location. | | `storeName` | `System.Security.Cryptography.X509Certificates.StoreName` | The certificate store name. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *thumbprint* is null or whitespace. | ### .ctor Initializes a new instance of the [ClientCertificate](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCertificate) class for file-based certificates. #### Syntax ```csharp theme={"dark"} public ClientCertificate(string filePath, string password = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The path to the certificate file. | | `password` | `string?` | The password for encrypted files (optional). | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *filePath* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Base64Data Gets or sets the Base64-encoded certificate data. #### Syntax ```csharp theme={"dark"} public string Base64Data { get; set; } ``` #### Property Value Type: `string?` The certificate data in Base64 format (used when Source is Base64). #### Remarks This allows certificates to be embedded directly in configuration. While convenient for some scenarios, this method should be used carefully to avoid exposing internal keys in configuration files. ### CheckRevocation Gets or sets a value indicating whether to check certificate revocation. #### Syntax ```csharp theme={"dark"} public bool CheckRevocation { get; set; } ``` #### Property Value Type: `bool` `true` if certificate revocation should be checked; otherwise, `false`. #### Remarks Revocation checking ensures the certificate hasn't been revoked by the issuing authority. This requires network access to revocation services and may impact performance. ### FilePath Gets or sets the file path for file-based certificates. #### Syntax ```csharp theme={"dark"} public string FilePath { get; set; } ``` #### Property Value Type: `string?` The path to the certificate file (used when Source is File). #### Remarks The file path can point to various certificate formats including .pfx, .p12, .cer, and .crt files. Password-protected files require the Password property to be set. ### Password Gets or sets the password for encrypted certificate files. #### Syntax ```csharp theme={"dark"} public string Password { get; set; } ``` #### Property Value Type: `string?` The password to decrypt the certificate file. #### Remarks This password is used when loading encrypted certificate files such as .pfx or .p12 files. It should be stored securely and not logged. ### Source Gets or sets the source of the client certificate. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.CertificateSource Source { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.CertificateSource?` The method used to locate and load the client certificate. #### Remarks Different certificate sources provide different levels of security and management complexity. Store-based certificates are typically more secure in production environments. ### StoreLocation Gets or sets the certificate store location. #### Syntax ```csharp theme={"dark"} public System.Security.Cryptography.X509Certificates.StoreLocation StoreLocation { get; set; } ``` #### Property Value Type: `System.Security.Cryptography.X509Certificates.StoreLocation?` The certificate store location (used when Source is Store). #### Remarks The store location determines which certificate store to search. CurrentUser is typically used for development, while LocalMachine is used for production services. ### StoreName Gets or sets the certificate store name. #### Syntax ```csharp theme={"dark"} public System.Security.Cryptography.X509Certificates.StoreName StoreName { get; set; } ``` #### Property Value Type: `System.Security.Cryptography.X509Certificates.StoreName?` The certificate store name (used when Source is Store). #### Remarks The store name determines which certificate store to search within the specified location. "My" (Personal) is the most common store for client certificates. ### SubjectName Gets or sets the certificate subject name for store-based lookup. #### Syntax ```csharp theme={"dark"} public string SubjectName { get; set; } ``` #### Property Value Type: `string?` The subject name of the certificate to locate. #### Remarks The subject name provides an alternative way to locate certificates when the thumbprint is not known. It should match the certificate's subject field exactly. ### Thumbprint Gets or sets the certificate thumbprint for store-based lookup. #### Syntax ```csharp theme={"dark"} public string Thumbprint { get; set; } ``` #### Property Value Type: `string?` The thumbprint (SHA-1 hash) of the certificate to locate. #### Remarks The thumbprint uniquely identifies a certificate within a store. It should be specified without spaces or special characters. ### ValidateChain Gets or sets a value indicating whether to validate the certificate chain. #### Syntax ```csharp theme={"dark"} public bool ValidateChain { get; set; } ``` #### Property Value Type: `bool` `true` if the certificate chain should be validated; otherwise, `false`. #### Remarks Chain validation ensures the certificate is issued by a trusted certificate authority. Disabling this should only be done in development environments with self-signed certificates. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### LoadCertificate Loads the certificate based on the configured source. #### Syntax ```csharp theme={"dark"} public System.Security.Cryptography.X509Certificates.X509Certificate2 LoadCertificate() ``` #### Returns Type: `System.Security.Cryptography.X509Certificates.X509Certificate2` The loaded X.509 certificate. #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown when the certificate cannot be loaded. | ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the client certificate configuration. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the certificate configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the client certificate configuration for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the configuration is valid. # ClientCredentials Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCredentials Represents client credentials for OAuth2 authentication. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.ClientCredentials ``` ## Summary Represents client credentials for OAuth2 authentication. ## Remarks These credentials identify the MCP server to authorization servers when performing OAuth2 flows that require client authentication, such as token exchange or on-behalf-of flows. ## Constructors ### .ctor Initializes a new instance of the [ClientCredentials](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCredentials) class. #### Syntax ```csharp theme={"dark"} public ClientCredentials() ``` ### .ctor Initializes a new instance of the [ClientCredentials](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCredentials) class with client secret authentication. #### Syntax ```csharp theme={"dark"} public ClientCredentials(string clientId, string clientSecret) ``` #### Parameters | Name | Type | Description | | - | - | - | | `clientId` | `string` | The client identifier. | | `clientSecret` | `string` | The client secret. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *clientId* or *clientSecret* is null or whitespace. | ### .ctor Initializes a new instance of the [ClientCredentials](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCredentials) class with certificate authentication. #### Syntax ```csharp theme={"dark"} public ClientCredentials(string clientId, Microsoft.OData.Mcp.Authentication.Models.ClientCertificate certificate) ``` #### Parameters | Name | Type | Description | | - | - | - | | `clientId` | `string` | The client identifier. | | `certificate` | `Microsoft.OData.Mcp.Authentication.Models.ClientCertificate` | The client certificate configuration. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *clientId* is null or whitespace. | | `ArgumentNullException` | Thrown when *certificate* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthenticationMethod Gets or sets the client authentication method. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.ClientAuthenticationMethod AuthenticationMethod { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.ClientAuthenticationMethod?` The method used to authenticate the client to the authorization server. #### Remarks Different authorization servers support different client authentication methods. The most common are client secrets and certificate-based authentication. ### Certificate Gets or sets the certificate for certificate-based authentication. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.ClientCertificate Certificate { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.ClientCertificate?` Configuration for client certificate authentication. #### Remarks This certificate is used when the authentication method requires certificate-based authentication. It provides a more secure alternative to client secrets. ### ClientAssertion Gets or sets the assertion for JWT-based client authentication. #### Syntax ```csharp theme={"dark"} public string ClientAssertion { get; set; } ``` #### Property Value Type: `string?` The JWT assertion used for client authentication. #### Remarks This is used when the authentication method is PrivateKeyJwt or ClientSecretJwt. The assertion must be properly signed and contain the required claims. ### ClientAssertionType Gets or sets the assertion type for JWT-based client authentication. #### Syntax ```csharp theme={"dark"} public string ClientAssertionType { get; set; } ``` #### Property Value Type: `string?` The type of the client assertion. #### Remarks This is typically "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" for JWT-based client authentication methods. ### ClientId Gets or sets the client identifier. #### Syntax ```csharp theme={"dark"} public required string ClientId { get; set; } ``` #### Property Value Type: `string` The client ID registered with the authorization server. #### Remarks The client ID uniquely identifies the MCP server application to the authorization server. It is typically a GUID or other unique string assigned during application registration. ### ClientSecret Gets or sets the client secret for secret-based authentication. #### Syntax ```csharp theme={"dark"} public string ClientSecret { get; set; } ``` #### Property Value Type: `string?` The client secret registered with the authorization server. #### Remarks This secret is used when the authentication method is ClientSecret or ClientSecretPost. It should be kept secure and rotated regularly for security best practices. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the client credentials. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the client credentials configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the client credentials for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the credentials are valid. # DelegatedToken Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/DelegatedToken Represents a token that has been delegated for use with a downstream service. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.DelegatedToken ``` ## Summary Represents a token that has been delegated for use with a downstream service. ## Remarks This class encapsulates the result of token delegation operations, including the delegated token itself, its metadata, and information about how it was obtained. ## Constructors ### .ctor Initializes a new instance of the [DelegatedToken](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/DelegatedToken) class. #### Syntax ```csharp theme={"dark"} public DelegatedToken() ``` ### .ctor Initializes a new instance of the [DelegatedToken](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/DelegatedToken) class with the specified access token and target service. #### Syntax ```csharp theme={"dark"} public DelegatedToken(string accessToken, string targetServiceId) ``` #### Parameters | Name | Type | Description | | - | - | - | | `accessToken` | `string` | The delegated access token. | | `targetServiceId` | `string` | The target service identifier. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *accessToken* or *targetServiceId* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AccessToken Gets or sets the delegated access token. #### Syntax ```csharp theme={"dark"} public required string AccessToken { get; set; } ``` #### Property Value Type: `string` The access token that can be used to authenticate with the target service. #### Remarks This token should be included in the Authorization header when making requests to the target service. The format is typically "Bearer ". ### CanRefresh Gets or sets a value indicating whether this token can be refreshed. #### Syntax ```csharp theme={"dark"} public bool CanRefresh { get; } ``` #### Property Value Type: `bool` `true` if the token can be refreshed; otherwise, `false`. #### Remarks This is determined by whether a refresh token is available and the delegation strategy supports refresh operations. ### DelegationStrategy Gets or sets the delegation strategy used to obtain this token. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy DelegationStrategy { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy` The strategy that was used for token delegation. #### Remarks This information can be useful for debugging, auditing, and determining what operations are possible with the token (e.g., refresh capabilities). ### ExpiresAt Gets or sets the token expiration time. #### Syntax ```csharp theme={"dark"} public System.Nullable ExpiresAt { get; set; } ``` #### Property Value Type: `System.Nullable` The UTC date and time when the token expires. #### Remarks After this time, the token will no longer be valid for authentication. If a refresh token is available, it can be used to obtain a new access token. ### IsExpired Gets a value indicating whether this token is expired. #### Syntax ```csharp theme={"dark"} public bool IsExpired { get; } ``` #### Property Value Type: `bool` `true` if the token is expired; otherwise, `false`. ### IssuedAt Gets or sets the time when the token was issued. #### Syntax ```csharp theme={"dark"} public System.DateTime IssuedAt { get; set; } ``` #### Property Value Type: `System.DateTime` The UTC date and time when the token was issued. #### Remarks This timestamp indicates when the token delegation operation completed successfully and the token became available for use. ### Metadata Gets or sets additional metadata about the token delegation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of metadata key-value pairs. #### Remarks This can include information such as the delegation endpoint used, client credentials applied, or other context that might be useful for debugging or auditing. ### OriginalToken Gets or sets the original token that was used for delegation. #### Syntax ```csharp theme={"dark"} public string OriginalToken { get; set; } ``` #### Property Value Type: `string?` The user's original token that was delegated. #### Remarks This is stored for auditing purposes and potential token refresh operations. It should be handled securely and not logged or exposed unnecessarily. ### RefreshToken Gets or sets the refresh token, if available. #### Syntax ```csharp theme={"dark"} public string RefreshToken { get; set; } ``` #### Property Value Type: `string?` The refresh token that can be used to obtain new access tokens. #### Remarks Refresh tokens allow obtaining new access tokens without requiring user re-authentication. Not all delegation scenarios provide refresh tokens. ### RemainingLifetime Gets the remaining lifetime of the token. #### Syntax ```csharp theme={"dark"} public System.Nullable RemainingLifetime { get; } ``` #### Property Value Type: `System.Nullable` The time remaining before the token expires, or null if no expiration is set. ### Scopes Gets or sets the scopes granted for this token. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Scopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of OAuth2 scopes that define what the token can access. #### Remarks These scopes may be a subset of the originally requested scopes, depending on what the authorization server granted for the target service. ### TargetAudience Gets or sets the target audience for the token. #### Syntax ```csharp theme={"dark"} public string TargetAudience { get; set; } ``` #### Property Value Type: `string?` The audience claim for which the token was issued. #### Remarks This is the intended recipient of the token and should match the target service's expected audience value. ### TargetServiceId Gets or sets the target service identifier. #### Syntax ```csharp theme={"dark"} public required string TargetServiceId { get; set; } ``` #### Property Value Type: `string` The identifier of the service this token is intended for. #### Remarks This identifies which service configuration was used to obtain the token and can be used for routing and caching decisions. ### TokenType Gets or sets the type of the token. #### Syntax ```csharp theme={"dark"} public string TokenType { get; set; } ``` #### Property Value Type: `string` The token type (e.g., "Bearer", "JWT"). #### Remarks This indicates how the token should be used in HTTP requests. Most OAuth2 implementations use "Bearer" tokens. ## Methods ### AddMetadata Adds metadata to the delegated token. #### Syntax ```csharp theme={"dark"} public void AddMetadata(string key, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | | `value` | `object` | The metadata value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### CreateFromExchange Creates a delegated token from a token exchange result. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Authentication.Models.DelegatedToken CreateFromExchange(string exchangedToken, string targetServiceId, string originalToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `exchangedToken` | `string` | The token received from the exchange. | | `targetServiceId` | `string` | The target service identifier. | | `originalToken` | `string?` | The original token that was exchanged. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.DelegatedToken` A delegated token configured for token exchange. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *exchangedToken* or *targetServiceId* is null or whitespace. | ### CreateFromOnBehalfOf Creates a delegated token from an on-behalf-of flow result. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Authentication.Models.DelegatedToken CreateFromOnBehalfOf(string onBehalfOfToken, string targetServiceId, string originalToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `onBehalfOfToken` | `string` | The token received from the on-behalf-of flow. | | `targetServiceId` | `string` | The target service identifier. | | `originalToken` | `string?` | The original token used for the on-behalf-of flow. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.DelegatedToken` A delegated token configured for on-behalf-of flow. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *onBehalfOfToken* or *targetServiceId* is null or whitespace. | ### CreatePassThrough Creates a delegated token for pass-through scenarios. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Authentication.Models.DelegatedToken CreatePassThrough(string originalToken, string targetServiceId) ``` #### Parameters | Name | Type | Description | | - | - | - | | `originalToken` | `string` | The original token to pass through. | | `targetServiceId` | `string` | The target service identifier. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.DelegatedToken` A delegated token configured for pass-through. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *originalToken* or *targetServiceId* is null or whitespace. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAuthorizationHeaderValue Gets the authorization header value for HTTP requests. #### Syntax ```csharp theme={"dark"} public string GetAuthorizationHeaderValue() ``` #### Returns Type: `string` The complete authorization header value (e.g., "Bearer "). ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadata Gets metadata value by key. #### Syntax ```csharp theme={"dark"} public T GetMetadata(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | #### Returns Type: `T?` The metadata value if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the metadata value. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ShouldRefresh Determines whether the token should be refreshed based on its expiration time. #### Syntax ```csharp theme={"dark"} public bool ShouldRefresh(System.TimeSpan refreshThreshold) ``` #### Parameters | Name | Type | Description | | - | - | - | | `refreshThreshold` | `System.TimeSpan` | The time before expiration when refresh should be considered. | #### Returns Type: `bool` `true` if the token should be refreshed; otherwise, `false`. ### ToString Returns a string representation of the delegated token. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the delegated token. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### WithUpdatedToken Creates a copy of the delegated token with updated values. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.DelegatedToken WithUpdatedToken(string newAccessToken, System.Nullable newExpiresAt = null, string newRefreshToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `newAccessToken` | `string` | The new access token value. | | `newExpiresAt` | `System.Nullable` | The new expiration time. | | `newRefreshToken` | `string?` | The new refresh token. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.DelegatedToken` A new delegated token instance with updated values. # EntityScopeRequirements Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements Defines scope requirements for operations on a specific entity type. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.EntityScopeRequirements ``` ## Summary Defines scope requirements for operations on a specific entity type. ## Remarks Entity scope requirements allow fine-grained authorization control at the entity level, enabling different access policies for different types of data within the same OData service. ## Constructors ### .ctor Initializes a new instance of the [EntityScopeRequirements](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements) class. #### Syntax ```csharp theme={"dark"} public EntityScopeRequirements() ``` ### .ctor Initializes a new instance of the [EntityScopeRequirements](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements) class with the same scopes for all operations. #### Syntax ```csharp theme={"dark"} public EntityScopeRequirements(System.Collections.Generic.IEnumerable allOperationsScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `allOperationsScopes` | `System.Collections.Generic.IEnumerable` | The scopes required for all operations on this entity. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *allOperationsScopes* is null. | ### .ctor Initializes a new instance of the [EntityScopeRequirements](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements) class with separate read and write scopes. #### Syntax ```csharp theme={"dark"} public EntityScopeRequirements(System.Collections.Generic.IEnumerable readScopes, System.Collections.Generic.IEnumerable writeScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `readScopes` | `System.Collections.Generic.IEnumerable` | The scopes required for read operations. | | `writeScopes` | `System.Collections.Generic.IEnumerable` | The scopes required for write operations. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *readScopes* or *writeScopes* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CreateScopes Gets or sets the scopes required for creating entities of this type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List CreateScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes that allow create access to the entity. #### Remarks Users must have at least one of these scopes to create new instances of this entity type. ### CustomOperationScopes Gets or sets custom scope requirements for specific operations. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> CustomOperationScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A mapping of custom operation names to their required scopes. #### Remarks This allows defining scope requirements for custom operations beyond the standard CRUD operations. The operation names should match those used in the MCP tool definitions. ### DeleteScopes Gets or sets the scopes required for deleting entities of this type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DeleteScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes that allow delete access to the entity. #### Remarks Users must have at least one of these scopes to delete instances of this entity type. ### NavigateScopes Gets or sets the scopes required for navigating to related entities. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List NavigateScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes that allow navigation to related entities. #### Remarks Users must have at least one of these scopes to follow navigation properties from this entity type to related entities. ### QueryScopes Gets or sets the scopes required for querying entities of this type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List QueryScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes that allow query access to the entity. #### Remarks Users must have at least one of these scopes to perform complex queries, filtering, and sorting on this entity type. ### ReadScopes Gets or sets the scopes required for reading entities of this type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ReadScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes that allow read access to the entity. #### Remarks Users must have at least one of these scopes to query, retrieve, or navigate to entities of this type. ### UpdateScopes Gets or sets the scopes required for updating entities of this type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List UpdateScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes that allow update access to the entity. #### Remarks Users must have at least one of these scopes to modify existing instances of this entity type. ## Methods ### AddCustomOperation Adds a custom operation with its required scopes. #### Syntax ```csharp theme={"dark"} public void AddCustomOperation(string operationName, System.Collections.Generic.IEnumerable scopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operationName` | `string` | The name of the custom operation. | | `scopes` | `System.Collections.Generic.IEnumerable` | The required scopes for the operation. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *operationName* is null or whitespace. | | `ArgumentNullException` | Thrown when *scopes* is null. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAllScopes Gets all unique scopes defined for this entity across all operations. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetAllScopes() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of all unique scopes defined for this entity. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetScopesForOperation Gets the required scopes for a specific operation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetScopesForOperation(string operation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operation` | `string` | The operation name (e.g., "read", "create", "update", "delete", "query", "navigate"). | #### Returns Type: `System.Collections.Generic.IEnumerable` The required scopes for the operation, or an empty collection if no specific requirement exists. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasAnyScopes Determines whether any scopes are defined for this entity. #### Syntax ```csharp theme={"dark"} public bool HasAnyScopes() ``` #### Returns Type: `bool` `true` if any scopes are defined; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetScopesForOperation Sets the required scopes for a specific operation. #### Syntax ```csharp theme={"dark"} public void SetScopesForOperation(string operation, System.Collections.Generic.IEnumerable scopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operation` | `string` | The operation name. | | `scopes` | `System.Collections.Generic.IEnumerable` | The required scopes for the operation. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *operation* is null or whitespace. | | `ArgumentNullException` | Thrown when *scopes* is null. | ### ToString Returns a string representation of the entity scope requirements. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the scope requirements for this entity. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the entity scope requirements for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the requirements are valid. # JwtBearerOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/JwtBearerOptions Configuration options for JWT bearer token validation. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.JwtBearerOptions ``` ## Summary Configuration options for JWT bearer token validation. ## Remarks These options control how JWT tokens are validated by the MCP server when acting as an OAuth2 resource server. They define the trust relationship with authorization servers and specify validation requirements. ## Constructors ### .ctor Initializes a new instance of the [JwtBearerOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/JwtBearerOptions) class. #### Syntax ```csharp theme={"dark"} public JwtBearerOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdditionalValidationParameters Gets or sets additional token validation parameters. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary AdditionalValidationParameters { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom validation parameters and their values. #### Remarks These parameters allow for custom token validation logic beyond the standard JWT validation. They can be used to enforce additional security requirements specific to the deployment environment. ### Audience Gets or sets the expected audience for JWT tokens. #### Syntax ```csharp theme={"dark"} public string Audience { get; set; } ``` #### Property Value Type: `string?` The audience claim value that must be present in valid tokens. #### Remarks The audience identifies this MCP server as a valid recipient for the token. Tokens without the correct audience claim will be rejected. This is typically the API identifier or base URL of the MCP server. ### Authority Gets or sets the authority URL of the OAuth2 authorization server. #### Syntax ```csharp theme={"dark"} public string Authority { get; set; } ``` #### Property Value Type: `string?` The base URL of the authorization server (e.g., "[https://login.microsoftonline.com/tenant-id](https://login.microsoftonline.com/tenant-id)"). #### Remarks This URL is used to discover the authorization server's metadata, including the JWKS endpoint for token validation keys. The authority must support OpenID Connect discovery. ### ClockSkew Gets or sets the clock skew tolerance for token validation. #### Syntax ```csharp theme={"dark"} public System.TimeSpan ClockSkew { get; set; } ``` #### Property Value Type: `System.TimeSpan?` The maximum allowed time difference between token and server clocks. #### Remarks Clock skew tolerance accounts for small time differences between the authorization server and MCP server clocks. This prevents valid tokens from being rejected due to minor time synchronization issues. ### Issuer Gets or sets the expected issuer for JWT tokens. #### Syntax ```csharp theme={"dark"} public string Issuer { get; set; } ``` #### Property Value Type: `string?` The issuer claim value that must be present in valid tokens. #### Remarks The issuer identifies the authorization server that issued the token. When specified, tokens from other issuers will be rejected. If not specified, the issuer will be derived from the Authority during metadata discovery. ### MetadataAddress Gets or sets the URL of the JWKS (JSON Web Key Set) endpoint. #### Syntax ```csharp theme={"dark"} public string MetadataAddress { get; set; } ``` #### Property Value Type: `string?` The URL where JWT signing keys can be retrieved. #### Remarks If not specified, the JWKS URL will be discovered from the authorization server's metadata. Manually specifying this can improve startup performance and provide more control over key retrieval. ### RequiredScopes Gets or sets the required OAuth2 scopes for accessing the MCP server. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List RequiredScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scope names that must be present in valid tokens. #### Remarks When specified, tokens must contain at least one of these scopes to be considered valid. Scopes provide fine-grained authorization control beyond basic authentication. ### RequireHttpsMetadata Gets or sets a value indicating whether to require HTTPS for metadata retrieval. #### Syntax ```csharp theme={"dark"} public bool RequireHttpsMetadata { get; set; } ``` #### Property Value Type: `bool` `true` if HTTPS is required for metadata retrieval; otherwise, `false`. #### Remarks Requiring HTTPS for metadata retrieval ensures the integrity and confidentiality of validation keys and other security-critical information. This should be enabled in production environments. ### ValidateAudience Gets or sets a value indicating whether to validate the token audience. #### Syntax ```csharp theme={"dark"} public bool ValidateAudience { get; set; } ``` #### Property Value Type: `bool` `true` if the audience should be validated; otherwise, `false`. #### Remarks Audience validation ensures tokens are intended for this service. Disabling this validation allows tokens intended for other services, which may be a security risk. ### ValidateIssuer Gets or sets a value indicating whether to validate the token issuer. #### Syntax ```csharp theme={"dark"} public bool ValidateIssuer { get; set; } ``` #### Property Value Type: `bool` `true` if the issuer should be validated; otherwise, `false`. #### Remarks Issuer validation ensures tokens come from trusted authorization servers. Disabling this validation reduces security and should only be done in development scenarios. ### ValidateIssuerSigningKey Gets or sets a value indicating whether to validate the token signature. #### Syntax ```csharp theme={"dark"} public bool ValidateIssuerSigningKey { get; set; } ``` #### Property Value Type: `bool` `true` if the token signature should be validated; otherwise, `false`. #### Remarks Signature validation ensures tokens haven't been tampered with and come from trusted sources. Disabling this validation should never be done in production as it completely undermines token security. ### ValidateLifetime Gets or sets a value indicating whether to validate the token lifetime. #### Syntax ```csharp theme={"dark"} public bool ValidateLifetime { get; set; } ``` #### Property Value Type: `bool` `true` if the token lifetime should be validated; otherwise, `false`. #### Remarks Lifetime validation ensures tokens are not expired or used before their valid time period. Disabling this validation allows expired tokens, which is a significant security risk. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the JWT bearer options. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the JWT bearer configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the JWT bearer options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the options are valid. # McpAuthenticationOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/McpAuthenticationOptions Configuration options for MCP server authentication. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions ``` ## Summary Configuration options for MCP server authentication. ## Remarks These options control how the MCP server validates and delegates authentication tokens. The server acts as an OAuth2 resource server, validating tokens issued by external authorization servers and optionally forwarding them to downstream OData services. ## Constructors ### .ctor Initializes a new instance of the [McpAuthenticationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/McpAuthenticationOptions) class. #### Syntax ```csharp theme={"dark"} public McpAuthenticationOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Enabled Gets or sets a value indicating whether authentication is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` if authentication is enabled; otherwise, `false`. #### Remarks When disabled, the MCP server will allow all requests without authentication. This is useful for development scenarios or internal deployments where authentication is handled at a different layer. ### JwtBearer Gets or sets the JWT bearer token options. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.JwtBearerOptions JwtBearer { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.JwtBearerOptions` Configuration for JWT token validation. #### Remarks These options control how JWT tokens are validated, including issuer validation, audience validation, and token lifetime checks. ### MetadataCacheDuration Gets or sets the cache duration for authentication metadata. #### Syntax ```csharp theme={"dark"} public System.TimeSpan MetadataCacheDuration { get; set; } ``` #### Property Value Type: `System.TimeSpan` The duration to cache authentication metadata like JWKS keys. #### Remarks Caching authentication metadata improves performance by avoiding repeated requests to authorization servers. The cache is automatically refreshed when metadata expires. ### RequireHttps Gets or sets a value indicating whether to require HTTPS for authentication. #### Syntax ```csharp theme={"dark"} public bool RequireHttps { get; set; } ``` #### Property Value Type: `bool` `true` if HTTPS is required for authentication; otherwise, `false`. #### Remarks When true, the server will reject authentication attempts over insecure connections. This should be enabled in production environments to protect authentication tokens. ### Scheme Gets or sets the authentication scheme to use. #### Syntax ```csharp theme={"dark"} public string Scheme { get; set; } ``` #### Property Value Type: `string` The authentication scheme name (e.g., "Bearer", "JWT"). #### Remarks This determines which authentication handler will be used to validate incoming requests. The default is "Bearer" for JWT bearer token authentication. ### ScopeAuthorization Gets or sets the scope-based authorization options. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.ScopeAuthorizationOptions ScopeAuthorization { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.ScopeAuthorizationOptions` Configuration for OAuth2 scope-based access control. #### Remarks These options define which OAuth2 scopes are required for different MCP operations and how scope-based authorization is enforced. ### Timeout Gets or sets the timeout for authentication operations. #### Syntax ```csharp theme={"dark"} public System.TimeSpan Timeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The timeout duration for authentication operations. #### Remarks This timeout applies to operations like token validation, metadata discovery, and communication with authorization servers. ### TokenDelegation Gets or sets the token delegation options. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.TokenDelegationOptions TokenDelegation { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.TokenDelegationOptions` Configuration for token delegation to downstream services. #### Remarks These options control how tokens are forwarded to OData services and other downstream dependencies that require authentication. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the authentication options. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the authentication configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the authentication options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the options are valid. # RetryPolicyOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/RetryPolicyOptions Configuration options for retry policies in authentication operations. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.RetryPolicyOptions ``` ## Summary Configuration options for retry policies in authentication operations. ## Remarks Retry policies help handle transient failures in authentication and token delegation operations, such as network timeouts, temporary service unavailability, or rate limiting from authorization servers. ## Constructors ### .ctor Initializes a new instance of the [RetryPolicyOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/RetryPolicyOptions) class. #### Syntax ```csharp theme={"dark"} public RetryPolicyOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BackoffStrategy Gets or sets the backoff strategy for calculating retry delays. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.BackoffStrategy BackoffStrategy { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.BackoffStrategy` The strategy used to calculate delays between retry attempts. #### Remarks Different backoff strategies provide different trade-offs between recovery speed and load on the target service. Exponential backoff is generally recommended for most scenarios. ### BaseDelay Gets or sets the base delay between retry attempts. #### Syntax ```csharp theme={"dark"} public System.TimeSpan BaseDelay { get; set; } ``` #### Property Value Type: `System.TimeSpan` The initial delay before the first retry attempt. #### Remarks The actual delay may be modified by the backoff strategy. This value should be chosen based on the expected recovery time for transient failures. ### CircuitBreakerFailureThreshold Gets or sets the circuit breaker failure threshold. #### Syntax ```csharp theme={"dark"} public int CircuitBreakerFailureThreshold { get; set; } ``` #### Property Value Type: `int` The number of consecutive failures that will trip the circuit breaker. #### Remarks Once this many consecutive failures occur, the circuit breaker will "open" and prevent further attempts for a period of time. This helps avoid overwhelming a failing service. ### CircuitBreakerTimeout Gets or sets the circuit breaker recovery timeout. #### Syntax ```csharp theme={"dark"} public System.TimeSpan CircuitBreakerTimeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The time to wait before attempting to close an open circuit breaker. #### Remarks After the circuit breaker opens, it will remain open for this duration before allowing a test request to check if the service has recovered. ### Enabled Gets or sets a value indicating whether retry is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` if retry is enabled; otherwise, `false`. #### Remarks When disabled, failed operations will not be retried and will fail immediately. Enabling retries can improve reliability but may increase latency for operations that ultimately fail. ### JitterFactor Gets or sets the jitter factor for randomizing retry delays. #### Syntax ```csharp theme={"dark"} public double JitterFactor { get; set; } ``` #### Property Value Type: `double` A value between 0.0 and 1.0 that controls the amount of randomization applied to delays. #### Remarks Jitter helps prevent the "thundering herd" problem when multiple clients retry simultaneously. A value of 0.0 disables jitter, while 1.0 allows delays to vary by up to 100% of the calculated value. ### MaxAttempts Gets or sets the maximum number of retry attempts. #### Syntax ```csharp theme={"dark"} public int MaxAttempts { get; set; } ``` #### Property Value Type: `int` The maximum number of times to retry a failed operation. #### Remarks This count does not include the initial attempt. For example, a value of 3 means the operation will be attempted up to 4 times total. Higher values provide more resilience but may cause longer delays. ### MaxDelay Gets or sets the maximum delay between retry attempts. #### Syntax ```csharp theme={"dark"} public System.TimeSpan MaxDelay { get; set; } ``` #### Property Value Type: `System.TimeSpan` The maximum time to wait before a retry attempt. #### Remarks This prevents exponential backoff from creating extremely long delays. The actual delay will be capped at this value regardless of the backoff calculation. ### RetryableExceptionTypes Gets or sets the exception types that should trigger retries. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet RetryableExceptionTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of exception type names that indicate retryable failures. #### Remarks Exceptions of these types will trigger retries. The type names should be the full type name including namespace. This is typically used for network-related exceptions like timeouts and connection failures. ### RetryableStatusCodes Gets or sets the HTTP status codes that should trigger retries. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet RetryableStatusCodes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of HTTP status codes that indicate retryable failures. #### Remarks Only failures with these status codes will be retried. Other status codes will cause the operation to fail immediately. Common retryable codes include 429 (Too Many Requests), 502 (Bad Gateway), and 503 (Service Unavailable). ### UseCircuitBreaker Gets or sets a value indicating whether to use circuit breaker pattern. #### Syntax ```csharp theme={"dark"} public bool UseCircuitBreaker { get; set; } ``` #### Property Value Type: `bool` `true` if circuit breaker should be used; otherwise, `false`. #### Remarks The circuit breaker pattern prevents cascading failures by temporarily stopping retries when a service is consistently failing. This can improve overall system stability during outages. ## Methods ### CalculateDelay Calculates the delay for a specific retry attempt. #### Syntax ```csharp theme={"dark"} public System.TimeSpan CalculateDelay(int attemptNumber) ``` #### Parameters | Name | Type | Description | | - | - | - | | `attemptNumber` | `int` | The retry attempt number (starting from 1). | #### Returns Type: `System.TimeSpan` The delay to wait before the retry attempt. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ShouldRetry Determines whether an exception should trigger a retry. #### Syntax ```csharp theme={"dark"} public bool ShouldRetry(System.Exception exception) ``` #### Parameters | Name | Type | Description | | - | - | - | | `exception` | `System.Exception` | The exception to check. | #### Returns Type: `bool` `true` if the exception should trigger a retry; otherwise, `false`. ### ShouldRetry Determines whether an HTTP status code should trigger a retry. #### Syntax ```csharp theme={"dark"} public bool ShouldRetry(int statusCode) ``` #### Parameters | Name | Type | Description | | - | - | - | | `statusCode` | `int` | The HTTP status code to check. | #### Returns Type: `bool` `true` if the status code should trigger a retry; otherwise, `false`. ### ToString Returns a string representation of the retry policy options. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the retry policy configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the retry policy options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the options are valid. # ScopeAuthorizationOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ScopeAuthorizationOptions Configuration options for OAuth2 scope-based authorization. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.ScopeAuthorizationOptions ``` ## Summary Configuration options for OAuth2 scope-based authorization. ## Remarks These options control how OAuth2 scopes are used to authorize access to different MCP tools and operations. Scope-based authorization provides fine-grained access control beyond basic authentication. ## Constructors ### .ctor Initializes a new instance of the [ScopeAuthorizationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ScopeAuthorizationOptions) class. #### Syntax ```csharp theme={"dark"} public ScopeAuthorizationOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DefaultRequiredScopes Gets or sets the default scopes required when no specific requirement is defined. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DefaultRequiredScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of scopes required for operations without specific scope requirements. #### Remarks These scopes are used as a fallback when no specific scope requirements are defined for an operation, tool, or entity. This ensures a baseline level of access control. ### Enabled Gets or sets a value indicating whether scope-based authorization is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` if scope-based authorization is enabled; otherwise, `false`. #### Remarks When enabled, the MCP server will check token scopes before allowing access to tools and operations. When disabled, all authenticated users have access to all available tools. ### EnforcementBehavior Gets or sets the behavior when required scopes are missing. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.ScopeEnforcementBehavior EnforcementBehavior { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.ScopeEnforcementBehavior` The action to take when a user lacks required scopes. #### Remarks Different behaviors provide different user experiences and security postures. Denying access is most secure, while filtering tools provides a better user experience at the cost of complexity. ### EntityScopes Gets or sets the entity-specific scope requirements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary EntityScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A mapping of entity types to their required scopes for different operations. #### Remarks This allows different entities to have different access requirements. For example, sensitive entities might require higher-privilege scopes than general-purpose entities. ### LogAuthorizationDecisions Gets or sets a value indicating whether to log scope authorization decisions. #### Syntax ```csharp theme={"dark"} public bool LogAuthorizationDecisions { get; set; } ``` #### Property Value Type: `bool` `true` if scope decisions should be logged; otherwise, `false`. #### Remarks Logging scope decisions helps with troubleshooting authorization issues and provides audit trails for security compliance. However, it may generate significant log volume in high-traffic scenarios. ### RequiredScopes Gets or sets the required scopes for different MCP operations. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> RequiredScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A mapping of operation types to their required scopes. #### Remarks This mapping defines which scopes are required for different types of MCP operations. Users must have at least one of the required scopes to perform the operation. ### ScopeClaimName Gets or sets the claim name that contains the scopes in JWT tokens. #### Syntax ```csharp theme={"dark"} public string ScopeClaimName { get; set; } ``` #### Property Value Type: `string` The name of the claim that contains scope information. #### Remarks Different authorization servers use different claim names for scopes. Common values include "scope", "scp", and "permissions". The claim can contain a space-separated string or an array of scope values. ### ScopeSeparator Gets or sets the scope separator character for space-separated scope claims. #### Syntax ```csharp theme={"dark"} public char ScopeSeparator { get; set; } ``` #### Property Value Type: `char` The character used to separate multiple scopes in a single claim value. #### Remarks When scopes are provided as a space-separated string, this character is used to split them into individual scope values. Space is the standard separator according to OAuth2 specifications. ### ToolScopes Gets or sets the tool-specific scope requirements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> ToolScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A mapping of tool names to their required scopes. #### Remarks This provides fine-grained control over individual MCP tools. Tool-specific requirements override general operation requirements for the specified tools. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetRequiredScopesForEntity Gets the required scopes for a specific entity and operation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetRequiredScopesForEntity(string entityType, string operation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `string` | The entity type name. | | `operation` | `string` | The operation being performed on the entity. | #### Returns Type: `System.Collections.Generic.IEnumerable` The required scopes, or the default scopes if no specific requirement exists. ### GetRequiredScopesForOperation Gets the required scopes for a specific operation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetRequiredScopesForOperation(string operation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operation` | `string` | The operation name. | #### Returns Type: `System.Collections.Generic.IEnumerable` The required scopes, or the default scopes if no specific requirement exists. ### GetRequiredScopesForTool Gets the required scopes for a specific tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetRequiredScopesForTool(string toolName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `toolName` | `string` | The tool name. | #### Returns Type: `System.Collections.Generic.IEnumerable` The required scopes, or the default scopes if no specific requirement exists. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetRequiredScopesForOperation Adds or updates scope requirements for an operation. #### Syntax ```csharp theme={"dark"} public void SetRequiredScopesForOperation(string operation, System.Collections.Generic.IEnumerable scopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operation` | `string` | The operation name. | | `scopes` | `System.Collections.Generic.IEnumerable` | The required scopes for the operation. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *operation* is null or whitespace. | | `ArgumentNullException` | Thrown when *scopes* is null. | ### SetRequiredScopesForTool Adds or updates scope requirements for a tool. #### Syntax ```csharp theme={"dark"} public void SetRequiredScopesForTool(string toolName, System.Collections.Generic.IEnumerable scopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `toolName` | `string` | The tool name. | | `scopes` | `System.Collections.Generic.IEnumerable` | The required scopes for the tool. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *toolName* is null or whitespace. | | `ArgumentNullException` | Thrown when *scopes* is null. | ### ToString Returns a string representation of the scope authorization options. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the scope authorization configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the scope authorization options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the options are valid. # ScopeEnforcementBehavior Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ScopeEnforcementBehavior Defines the behavior when required scopes are missing. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.ScopeEnforcementBehavior ``` ## Summary Defines the behavior when required scopes are missing. ## Values | Name | Value | Description | | - | - | - | | `DenyAccess` | 0 | Deny access to the operation or tool when required scopes are missing. | | `FilterTools` | 1 | Filter out tools and operations that the user cannot access due to missing scopes. | | `LogOnly` | 2 | Log the authorization decision but allow access even when scopes are missing. | # TargetServiceOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TargetServiceOptions Configuration options for a specific target service in token delegation. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.TargetServiceOptions ``` ## Summary Configuration options for a specific target service in token delegation. ## Remarks These options define how tokens should be handled when making requests to a specific downstream service. Each service can have its own delegation strategy, scopes, and authentication requirements. ## Constructors ### .ctor Initializes a new instance of the [TargetServiceOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TargetServiceOptions) class. #### Syntax ```csharp theme={"dark"} public TargetServiceOptions() ``` ### .ctor Initializes a new instance of the [TargetServiceOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TargetServiceOptions) class with the specified service ID and base URL. #### Syntax ```csharp theme={"dark"} public TargetServiceOptions(string serviceId, string baseUrl) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceId` | `string` | The unique identifier for the target service. | | `baseUrl` | `string` | The base URL of the target service. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *serviceId* or *baseUrl* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdditionalHeaders Gets or sets additional headers to include in requests to this service. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary AdditionalHeaders { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of header names and values to include in requests. #### Remarks These headers are added to all requests made to this service, in addition to the authentication token. They can be used for service-specific requirements like API versions or custom authentication schemes. ### BaseUrl Gets or sets the base URL of the target service. #### Syntax ```csharp theme={"dark"} public required string BaseUrl { get; set; } ``` #### Property Value Type: `string` The base URL where the service can be accessed. #### Remarks This URL is used to determine which requests should use this service's delegation configuration. Requests to URLs starting with this base URL will use these settings. ### ClientCredentials Gets or sets the client credentials for service-to-service authentication. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.ClientCredentials ClientCredentials { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.ClientCredentials?` Credentials used when the service requires client authentication. #### Remarks These credentials are used for OAuth2 flows that require client authentication, such as on-behalf-of or token exchange. They identify the MCP server to the authorization server. ### Scopes Gets or sets the scopes to request for this service. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Scopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of OAuth2 scopes to request when obtaining tokens for this service. #### Remarks These scopes define the level of access requested for the target service. They should be the minimum scopes required for the MCP server to perform its operations on behalf of the user. ### ServiceId Gets or sets the unique identifier for the target service. #### Syntax ```csharp theme={"dark"} public required string ServiceId { get; set; } ``` #### Property Value Type: `string` A unique string that identifies this service configuration. #### Remarks This identifier is used to look up the appropriate delegation configuration when making requests to downstream services. It should be unique within the MCP server's configuration. ### Strategy Gets or sets the token forwarding strategy for this service. #### Syntax ```csharp theme={"dark"} public System.Nullable Strategy { get; set; } ``` #### Property Value Type: `System.Nullable` The strategy to use when forwarding tokens to this service. #### Remarks If not specified, the global token delegation strategy will be used. Service-specific strategies allow for fine-grained control over how different services receive authentication tokens. ### TargetAudience Gets or sets the target audience for token exchange operations. #### Syntax ```csharp theme={"dark"} public string TargetAudience { get; set; } ``` #### Property Value Type: `string?` The audience claim to request when exchanging tokens for this service. #### Remarks When using token exchange or on-behalf-of flows, this audience identifies the target service for the new token. It's typically the service's API identifier or base URL. ### Timeout Gets or sets the timeout for requests to this service. #### Syntax ```csharp theme={"dark"} public System.Nullable Timeout { get; set; } ``` #### Property Value Type: `System.Nullable` The timeout duration for requests to this service. #### Remarks If not specified, the global delegation timeout will be used. Service-specific timeouts allow for different performance expectations for different services. ### TokenEndpoint Gets or sets the token endpoint URL for this service. #### Syntax ```csharp theme={"dark"} public string TokenEndpoint { get; set; } ``` #### Property Value Type: `string?` The URL of the token endpoint for OAuth2 operations. #### Remarks If not specified, the token endpoint will be discovered from the authorization server's metadata. Specifying this directly can improve performance and provide more control over token operations. ### ValidateBeforeForwarding Gets or sets a value indicating whether to validate tokens before sending to this service. #### Syntax ```csharp theme={"dark"} public System.Nullable ValidateBeforeForwarding { get; set; } ``` #### Property Value Type: `System.Nullable` `true` if tokens should be validated before forwarding; `null` to use global setting. #### Remarks This setting overrides the global token validation setting for this specific service. Some services may have different validation requirements or performance characteristics. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetEffectiveStrategy Gets the effective token forwarding strategy for this service. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy GetEffectiveStrategy(Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy globalStrategy) ``` #### Parameters | Name | Type | Description | | - | - | - | | `globalStrategy` | `Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy` | The global token forwarding strategy. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy` The strategy to use for this service. ### GetEffectiveTimeout Gets the effective timeout for this service. #### Syntax ```csharp theme={"dark"} public System.TimeSpan GetEffectiveTimeout(System.TimeSpan globalTimeout) ``` #### Parameters | Name | Type | Description | | - | - | - | | `globalTimeout` | `System.TimeSpan` | The global timeout setting. | #### Returns Type: `System.TimeSpan` The timeout to use for this service. ### GetEffectiveValidation Gets the effective validation setting for this service. #### Syntax ```csharp theme={"dark"} public bool GetEffectiveValidation(bool globalValidation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `globalValidation` | `bool` | The global validation setting. | #### Returns Type: `bool` The validation setting to use for this service. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MatchesUrl Determines whether a URL matches this target service configuration. #### Syntax ```csharp theme={"dark"} public bool MatchesUrl(string url) ``` #### Parameters | Name | Type | Description | | - | - | - | | `url` | `string` | The URL to check. | #### Returns Type: `bool` `true` if the URL matches this service; otherwise, `false`. ### MatchesUrl Determines whether a URI matches this target service configuration. #### Syntax ```csharp theme={"dark"} public bool MatchesUrl(System.Uri uri) ``` #### Parameters | Name | Type | Description | | - | - | - | | `uri` | `System.Uri` | The URI to check. | #### Returns Type: `bool` `true` if the URI matches this service; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the target service options. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the target service configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the target service options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the options are valid. # TokenDelegationOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenDelegationOptions Configuration options for token delegation to downstream services. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.TokenDelegationOptions ``` ## Summary Configuration options for token delegation to downstream services. ## Remarks These options control how authentication tokens are forwarded from the MCP server to downstream OData services and other dependencies. Token delegation preserves the user's identity throughout the request chain. ## Constructors ### .ctor Initializes a new instance of the [TokenDelegationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenDelegationOptions) class. #### Syntax ```csharp theme={"dark"} public TokenDelegationOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CacheDuration Gets or sets the cache duration for delegated tokens. #### Syntax ```csharp theme={"dark"} public System.TimeSpan CacheDuration { get; set; } ``` #### Property Value Type: `System.TimeSpan` The duration to cache delegated tokens. #### Remarks This duration should be shorter than the token's actual lifetime to ensure cached tokens don't expire unexpectedly. The cache automatically handles token refresh when possible. ### CacheTokens Gets or sets a value indicating whether to cache delegated tokens. #### Syntax ```csharp theme={"dark"} public bool CacheTokens { get; set; } ``` #### Property Value Type: `bool` `true` if delegated tokens should be cached; otherwise, `false`. #### Remarks Caching delegated tokens can improve performance by avoiding repeated token exchange operations. Cached tokens are automatically refreshed before expiration. ### Enabled Gets or sets a value indicating whether token delegation is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` if token delegation is enabled; otherwise, `false`. #### Remarks When enabled, the MCP server will forward authentication tokens to downstream services. When disabled, the server may use alternative authentication methods for downstream calls, such as service-to-service authentication. ### RetryPolicy Gets or sets the retry policy for failed token delegation operations. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.RetryPolicyOptions RetryPolicy { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.RetryPolicyOptions` Configuration for retrying failed token operations. #### Remarks Retry policies help handle transient failures in token delegation, such as network issues or temporary service unavailability. They should be configured carefully to avoid overwhelming downstream services. ### Strategy Gets or sets the token forwarding strategy. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy Strategy { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy` The strategy for forwarding tokens to downstream services. #### Remarks Different strategies provide different levels of security and functionality: * PassThrough: Forward the original token as-is * Exchange: Exchange the token for a new one scoped to the downstream service * OnBehalfOf: Use OAuth2 on-behalf-of flow for token delegation ### TargetServices Gets or sets the target services for token delegation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List TargetServices { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of service configurations for token forwarding. #### Remarks Each target service can have its own delegation configuration, including different forwarding strategies, scopes, and authentication parameters. ### Timeout Gets or sets the timeout for token delegation operations. #### Syntax ```csharp theme={"dark"} public System.TimeSpan Timeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The timeout duration for token delegation operations. #### Remarks This timeout applies to operations like token exchange, on-behalf-of flows, and communication with token endpoints. Operations that exceed this timeout will be cancelled. ### TokenExchange Gets or sets the token exchange options for services that support token exchange. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.TokenExchangeOptions TokenExchange { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.TokenExchangeOptions` Configuration for OAuth2 token exchange flows. #### Remarks Token exchange allows the MCP server to obtain tokens with different scopes or audiences for downstream services while maintaining the user's identity. ### ValidateBeforeForwarding Gets or sets a value indicating whether to validate delegated tokens before forwarding. #### Syntax ```csharp theme={"dark"} public bool ValidateBeforeForwarding { get; set; } ``` #### Property Value Type: `bool` `true` if delegated tokens should be validated; otherwise, `false`. #### Remarks Validating delegated tokens ensures they are properly formatted and not expired before forwarding them to downstream services. This can prevent downstream authentication failures but adds processing overhead. ## Methods ### AddOrUpdateTargetService Adds or updates target service options. #### Syntax ```csharp theme={"dark"} public void AddOrUpdateTargetService(Microsoft.OData.Mcp.Authentication.Models.TargetServiceOptions targetService) ``` #### Parameters | Name | Type | Description | | - | - | - | | `targetService` | `Microsoft.OData.Mcp.Authentication.Models.TargetServiceOptions` | The target service options to add or update. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *targetService* is null. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetTargetService Gets the target service options for a specific service identifier. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.TargetServiceOptions GetTargetService(string serviceId) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceId` | `string` | The identifier of the target service. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.TargetServiceOptions?` The target service options, or `null` if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the token delegation options. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the token delegation configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the token delegation options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the options are valid. # TokenExchangeOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenExchangeOptions Configuration options for OAuth2 token exchange operations. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.TokenExchangeOptions ``` ## Summary Configuration options for OAuth2 token exchange operations. ## Remarks Token exchange allows the MCP server to exchange user tokens for new tokens with different scopes or audiences, enabling secure delegation to downstream services while maintaining the user's identity. ## Constructors ### .ctor Initializes a new instance of the [TokenExchangeOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenExchangeOptions) class. #### Syntax ```csharp theme={"dark"} public TokenExchangeOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdditionalParameters Gets or sets additional parameters to include in token exchange requests. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary AdditionalParameters { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of parameter names and values to include in exchange requests. #### Remarks These parameters can be used to pass additional context or configuration to the authorization server during token exchange operations. ### ClientCredentials Gets or sets the client credentials used for token exchange. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.ClientCredentials ClientCredentials { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.ClientCredentials?` The credentials that identify the MCP server to the authorization server. #### Remarks These credentials are required for token exchange operations as they authenticate the MCP server's right to exchange tokens on behalf of users. ### DefaultScopes Gets or sets the default scopes to request during token exchange. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DefaultScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of OAuth2 scopes to request for exchanged tokens. #### Remarks These scopes define the permissions requested for the new token. The actual scopes granted may be a subset based on the original token's scopes and the authorization server's policies. ### MaxRetryAttempts Gets or sets the maximum number of retry attempts for failed token exchange operations. #### Syntax ```csharp theme={"dark"} public int MaxRetryAttempts { get; set; } ``` #### Property Value Type: `int` The number of times to retry failed token exchange operations. #### Remarks Retries help handle transient network issues or temporary service unavailability. The retry policy includes exponential backoff to avoid overwhelming the authorization server. ### RequestedTokenType Gets or sets the requested token type for token exchange. #### Syntax ```csharp theme={"dark"} public string RequestedTokenType { get; set; } ``` #### Property Value Type: `string` The token type of the output token being requested. #### Remarks This specifies what type of token should be returned from the exchange. Common values include access tokens and refresh tokens. ### RetryDelay Gets or sets the base delay between retry attempts. #### Syntax ```csharp theme={"dark"} public System.TimeSpan RetryDelay { get; set; } ``` #### Property Value Type: `System.TimeSpan` The initial delay before the first retry attempt. #### Remarks The actual delay uses exponential backoff, so subsequent retries will have progressively longer delays to reduce load on the authorization server. ### SubjectTokenType Gets or sets the default subject token type for token exchange. #### Syntax ```csharp theme={"dark"} public string SubjectTokenType { get; set; } ``` #### Property Value Type: `string` The token type of the input token being exchanged. #### Remarks Common values include "urn:ietf:params:oauth:token-type:access\_token" for access tokens and "urn:ietf:params:oauth:token-type:jwt" for JWT tokens. ### Timeout Gets or sets the timeout for token exchange operations. #### Syntax ```csharp theme={"dark"} public System.TimeSpan Timeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The maximum time to wait for token exchange operations to complete. #### Remarks Token exchange operations that exceed this timeout will be cancelled. This helps prevent hanging requests from impacting system performance. ### TokenEndpoint Gets or sets the token endpoint URL for token exchange operations. #### Syntax ```csharp theme={"dark"} public string TokenEndpoint { get; set; } ``` #### Property Value Type: `string?` The URL of the OAuth2 token endpoint that supports token exchange. #### Remarks This endpoint must support the RFC 8693 OAuth 2.0 Token Exchange specification. If not specified, the endpoint will be discovered from the authorization server's metadata. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the token exchange options. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the token exchange configuration. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the token exchange options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the options are valid. # TokenForwardingStrategy Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenForwardingStrategy Defines the strategies for forwarding tokens to downstream services. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.TokenForwardingStrategy ``` ## Summary Defines the strategies for forwarding tokens to downstream services. ## Values | Name | Value | Description | | - | - | - | | `PassThrough` | 0 | Forward the original token without modification. | | `Exchange` | 1 | Exchange the token for a new one using OAuth2 token exchange. | | `OnBehalfOf` | 2 | Use OAuth2 on-behalf-of flow to obtain a token for the downstream service. | # TokenValidationResult Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenValidationResult Represents the result of a token validation operation. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.TokenValidationResult ``` ## Summary Represents the result of a token validation operation. ## Remarks This class encapsulates the outcome of token validation, including success/failure status, the validated principal, and any validation errors that occurred during the process. ## Constructors ### .ctor Initializes a new instance of the [TokenValidationResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenValidationResult) class. #### Syntax ```csharp theme={"dark"} public TokenValidationResult() ``` ### .ctor Initializes a new instance of the [TokenValidationResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenValidationResult) class for a successful validation. #### Syntax ```csharp theme={"dark"} public TokenValidationResult(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The validated claims principal. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *principal* is null. | ### .ctor Initializes a new instance of the [TokenValidationResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenValidationResult) class for a failed validation. #### Syntax ```csharp theme={"dark"} public TokenValidationResult(string error, string errorDescription = null, System.Exception exception = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `error` | `string` | The validation error. | | `errorDescription` | `string?` | The detailed error description. | | `exception` | `System.Exception?` | The exception that caused the failure. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *error* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Error Gets or sets the validation error that occurred during token validation. #### Syntax ```csharp theme={"dark"} public string Error { get; set; } ``` #### Property Value Type: `string?` The validation error if validation failed; otherwise, `null`. #### Remarks This provides detailed information about why token validation failed, which can be useful for debugging and security auditing. ### ErrorDescription Gets or sets the detailed error description. #### Syntax ```csharp theme={"dark"} public string ErrorDescription { get; set; } ``` #### Property Value Type: `string?` A detailed description of the validation error; otherwise, `null`. #### Remarks This provides additional context about the validation failure, such as specific claims that were invalid or missing. ### Exception Gets or sets the exception that caused the validation failure. #### Syntax ```csharp theme={"dark"} public System.Exception Exception { get; set; } ``` #### Property Value Type: `System.Exception?` The exception that occurred during validation; otherwise, `null`. #### Remarks This is typically used for logging and debugging purposes to understand the root cause of validation failures. ### ExpiresAt Gets or sets the token expiration time. #### Syntax ```csharp theme={"dark"} public System.Nullable ExpiresAt { get; set; } ``` #### Property Value Type: `System.Nullable?` The UTC date and time when the token expires; otherwise, `null`. #### Remarks This is extracted from the token's 'exp' claim and represents when the token will no longer be valid for authentication. ### IssuedAt Gets or sets the token issued time. #### Syntax ```csharp theme={"dark"} public System.Nullable IssuedAt { get; set; } ``` #### Property Value Type: `System.Nullable?` The UTC date and time when the token was issued; otherwise, `null`. #### Remarks This is extracted from the token's 'iat' claim and represents when the token was originally created by the authorization server. ### IsValid Gets or sets a value indicating whether the token validation was successful. #### Syntax ```csharp theme={"dark"} public bool IsValid { get; set; } ``` #### Property Value Type: `bool` `true` if the token is valid; otherwise, `false`. ### Metadata Gets or sets additional validation metadata. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of additional information about the validation process. #### Remarks This can include information such as the validation time, token issuer, audience, or other metadata that might be useful for auditing or debugging. ### NotBefore Gets or sets the token not-before time. #### Syntax ```csharp theme={"dark"} public System.Nullable NotBefore { get; set; } ``` #### Property Value Type: `System.Nullable?` The UTC date and time before which the token is not valid; otherwise, `null`. #### Remarks This is extracted from the token's 'nbf' claim and represents the earliest time the token can be used for authentication. ### Principal Gets or sets the claims principal from the validated token. #### Syntax ```csharp theme={"dark"} public System.Security.Claims.ClaimsPrincipal Principal { get; set; } ``` #### Property Value Type: `System.Security.Claims.ClaimsPrincipal?` The claims principal if validation was successful; otherwise, `null`. #### Remarks This principal contains all the claims extracted from the JWT token and can be used for authorization decisions and user context extraction. ## Methods ### AddMetadata Adds metadata to the validation result. #### Syntax ```csharp theme={"dark"} public void AddMetadata(string key, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | | `value` | `object` | The metadata value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Failure Creates a failed validation result. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Authentication.Models.TokenValidationResult Failure(string error, string errorDescription = null, System.Exception exception = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `error` | `string` | The validation error. | | `errorDescription` | `string?` | The detailed error description. | | `exception` | `System.Exception?` | The exception that caused the failure. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.TokenValidationResult` A failed token validation result. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *error* is null or whitespace. | ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadata Gets metadata value by key. #### Syntax ```csharp theme={"dark"} public T GetMetadata(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | #### Returns Type: `T?` The metadata value if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the metadata value. ### GetRemainingLifetime Gets the remaining lifetime of the token. #### Syntax ```csharp theme={"dark"} public System.Nullable GetRemainingLifetime() ``` #### Returns Type: `System.Nullable?` The remaining time before the token expires, or null if no expiration is set. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### IsExpired Determines whether the token is currently expired. #### Syntax ```csharp theme={"dark"} public bool IsExpired() ``` #### Returns Type: `bool` `true` if the token is expired; otherwise, `false`. ### IsNotYetValid Determines whether the token is not yet valid. #### Syntax ```csharp theme={"dark"} public bool IsNotYetValid() ``` #### Returns Type: `bool` `true` if the token is not yet valid; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Success Creates a successful validation result. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Authentication.Models.TokenValidationResult Success(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The validated claims principal. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.TokenValidationResult` A successful token validation result. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *principal* is null. | ### ToString Returns a string representation of the token validation result. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the validation result. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # UserContext Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/UserContext Represents the user context extracted from an authenticated request. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.UserContext ``` ## Summary Represents the user context extracted from an authenticated request. ## Remarks This class encapsulates the user's identity, authorization information, and other context data needed for processing MCP requests on behalf of the user. ## Constructors ### .ctor Initializes a new instance of the [UserContext](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/UserContext) class. #### Syntax ```csharp theme={"dark"} public UserContext() ``` ### .ctor Initializes a new instance of the [UserContext](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/UserContext) class with the specified user ID. #### Syntax ```csharp theme={"dark"} public UserContext(string userId) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userId` | `string` | The user's unique identifier. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *userId* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AdditionalClaims Gets or sets additional user claims. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary AdditionalClaims { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of additional claims extracted from the token. #### Remarks This contains any custom claims that are not covered by the standard properties but may be needed for authorization or business logic. ### Audience Gets or sets the audience for which the token was issued. #### Syntax ```csharp theme={"dark"} public string Audience { get; set; } ``` #### Property Value Type: `string?` The audience identifier from the JWT token. #### Remarks This identifies the intended recipient of the token, which should match the MCP server's configuration. ### AuthenticatedAt Gets or sets the time when the user was authenticated. #### Syntax ```csharp theme={"dark"} public System.DateTime AuthenticatedAt { get; set; } ``` #### Property Value Type: `System.DateTime?` The UTC date and time when authentication occurred. #### Remarks This timestamp is used for session management, auditing, and security analysis. ### AuthenticationMethod Gets or sets the authentication method used. #### Syntax ```csharp theme={"dark"} public string AuthenticationMethod { get; set; } ``` #### Property Value Type: `string?` The method used to authenticate the user (e.g., "Bearer", "JWT"). #### Remarks This indicates how the user was authenticated, which can be useful for security auditing and compliance reporting. ### ClientId Gets or sets the client application identifier. #### Syntax ```csharp theme={"dark"} public string ClientId { get; set; } ``` #### Property Value Type: `string?` The identifier of the client application that initiated the request. #### Remarks This identifies which application the user is accessing the MCP server through, which can be useful for auditing and access control. ### DisplayName Gets or sets the user's display name. #### Syntax ```csharp theme={"dark"} public string DisplayName { get; set; } ``` #### Property Value Type: `string?` The display name or username of the authenticated user. #### Remarks This is typically extracted from claims like 'name', 'preferred\_username', or 'upn' and is used for display purposes in logs and audit trails. ### Email Gets or sets the user's email address. #### Syntax ```csharp theme={"dark"} public string Email { get; set; } ``` #### Property Value Type: `string?` The email address of the authenticated user. #### Remarks This is typically extracted from the 'email' claim and can be used for notifications or audit purposes. ### Issuer Gets or sets the issuer of the authentication token. #### Syntax ```csharp theme={"dark"} public string Issuer { get; set; } ``` #### Property Value Type: `string?` The issuer identifier from the JWT token. #### Remarks This identifies which authorization server issued the token, which is important for multi-provider scenarios and security auditing. ### Roles Gets or sets the user's roles. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Roles { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of roles assigned to the user. #### Remarks Roles provide a higher-level grouping of permissions and are typically extracted from 'roles' or similar claims in the token. ### Scopes Gets or sets the OAuth2 scopes granted to the user. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Scopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of OAuth2 scopes that define the user's permissions. #### Remarks These scopes are extracted from the token and determine what operations the user is authorized to perform through the MCP server. ### TenantId Gets or sets the tenant identifier for multi-tenant scenarios. #### Syntax ```csharp theme={"dark"} public string TenantId { get; set; } ``` #### Property Value Type: `string?` The identifier of the tenant the user belongs to. #### Remarks This is used in multi-tenant deployments to isolate data and operations between different organizational units or customers. ### Token Gets or sets the original JWT token. #### Syntax ```csharp theme={"dark"} public string Token { get; set; } ``` #### Property Value Type: `string?` The raw JWT token that was used for authentication. #### Remarks This token can be forwarded to downstream services for delegation scenarios while maintaining the user's identity. ### TokenExpiresAt Gets or sets the token expiration time. #### Syntax ```csharp theme={"dark"} public System.Nullable TokenExpiresAt { get; set; } ``` #### Property Value Type: `System.Nullable?` The UTC date and time when the token expires. #### Remarks This is used to determine when the user's session will expire and when token refresh might be needed. ### UserId Gets or sets the user's unique identifier. #### Syntax ```csharp theme={"dark"} public required string UserId { get; set; } ``` #### Property Value Type: `string` The unique identifier for the authenticated user. #### Remarks This is typically extracted from the 'sub' (subject) claim in the JWT token and uniquely identifies the user across the system. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FromClaimsPrincipal Creates a user context from a claims principal. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Authentication.Models.UserContext FromClaimsPrincipal(System.Security.Claims.ClaimsPrincipal principal, string token = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to extract user context from. | | `token` | `string?` | The original JWT token (optional). | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.UserContext` A user context populated with information from the claims principal. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *principal* is null. | | `InvalidOperationException` | Thrown when the principal does not contain a subject claim. | ### GetAdditionalClaim Gets an additional claim value by type. #### Syntax ```csharp theme={"dark"} public string GetAdditionalClaim(string claimType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `claimType` | `string` | The claim type to retrieve. | #### Returns Type: `string?` The claim value if found; otherwise, null. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetRemainingTokenLifetime Gets the remaining time before the token expires. #### Syntax ```csharp theme={"dark"} public System.Nullable GetRemainingTokenLifetime() ``` #### Returns Type: `System.Nullable?` The remaining time before token expiration, or null if no expiration is set. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasAllScopes Determines whether the user has all of the specified scopes. #### Syntax ```csharp theme={"dark"} public bool HasAllScopes(System.Collections.Generic.IEnumerable requiredScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `requiredScopes` | `System.Collections.Generic.IEnumerable` | The scopes to check for. | #### Returns Type: `bool` `true` if the user has all of the required scopes; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *requiredScopes* is null. | ### HasAnyRole Determines whether the user has any of the specified roles. #### Syntax ```csharp theme={"dark"} public bool HasAnyRole(System.Collections.Generic.IEnumerable requiredRoles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `requiredRoles` | `System.Collections.Generic.IEnumerable` | The roles to check for. | #### Returns Type: `bool` `true` if the user has at least one of the required roles; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *requiredRoles* is null. | ### HasAnyScope Determines whether the user has any of the specified scopes. #### Syntax ```csharp theme={"dark"} public bool HasAnyScope(System.Collections.Generic.IEnumerable requiredScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `requiredScopes` | `System.Collections.Generic.IEnumerable` | The scopes to check for. | #### Returns Type: `bool` `true` if the user has at least one of the required scopes; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *requiredScopes* is null. | ### IsTokenExpired Determines whether the user's token is expired. #### Syntax ```csharp theme={"dark"} public bool IsTokenExpired() ``` #### Returns Type: `bool` `true` if the token is expired; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the user context. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the user context. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/index Summary of the Microsoft.OData.Mcp.Authentication.Models Namespace ## Types ### Classes | Name | Summary | | - | - | | [AuthorizationMetadata](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/AuthorizationMetadata) | Represents authorization metadata extracted from a JWT token for use in downstream services. | | [BackoffStrategy](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/BackoffStrategy) | Defines the backoff strategies for retry delays. | | [CertificateSource](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/CertificateSource) | Defines the sources from which client certificates can be loaded. | | [ClientAuthenticationMethod](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientAuthenticationMethod) | Defines the client authentication methods supported by OAuth2. | | [ClientCertificate](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCertificate) | Configuration for client certificate authentication. | | [ClientCredentials](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCredentials) | Represents client credentials for OAuth2 authentication. | | [DelegatedToken](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/DelegatedToken) | Represents a token that has been delegated for use with a downstream service. | | [EntityScopeRequirements](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements) | Defines scope requirements for operations on a specific entity type. | | [JwtBearerOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/JwtBearerOptions) | Configuration options for JWT bearer token validation. | | [McpAuthenticationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/McpAuthenticationOptions) | Configuration options for MCP server authentication. | | [RetryPolicyOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/RetryPolicyOptions) | Configuration options for retry policies in authentication operations. | | [ScopeAuthorizationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ScopeAuthorizationOptions) | Configuration options for OAuth2 scope-based authorization. | | [ScopeEnforcementBehavior](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ScopeEnforcementBehavior) | Defines the behavior when required scopes are missing. | | [TargetServiceOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TargetServiceOptions) | Configuration options for a specific target service in token delegation. | | [TokenDelegationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenDelegationOptions) | Configuration options for token delegation to downstream services. | | [TokenExchangeOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenExchangeOptions) | Configuration options for OAuth2 token exchange operations. | | [TokenForwardingStrategy](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenForwardingStrategy) | Defines the strategies for forwarding tokens to downstream services. | | [TokenValidationResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenValidationResult) | Represents the result of a token validation operation. | | [UserContext](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/UserContext) | Represents the user context extracted from an authenticated request. | ### Enums | Name | Summary | | - | - | | [BackoffStrategy](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/BackoffStrategy) | Defines the backoff strategies for retry delays. | | [CertificateSource](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/CertificateSource) | Defines the sources from which client certificates can be loaded. | | [ClientAuthenticationMethod](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientAuthenticationMethod) | Defines the client authentication methods supported by OAuth2. | | [ScopeEnforcementBehavior](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ScopeEnforcementBehavior) | Defines the behavior when required scopes are missing. | | [TokenForwardingStrategy](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/TokenForwardingStrategy) | Defines the strategies for forwarding tokens to downstream services. | # ITokenDelegationService Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/ITokenDelegationService Provides services for delegating authentication tokens to downstream services. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Services ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Services.ITokenDelegationService ``` ## Summary Provides services for delegating authentication tokens to downstream services. ## Remarks This service handles the complexities of token delegation, including token forwarding, exchange, and on-behalf-of flows. It ensures that user identity is preserved while enabling secure communication with downstream OData services. ## Methods ### ClearCachedTokensAsync Clears all cached tokens for a specific user. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ClearCachedTokensAsync(string userId, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userId` | `string` | The user identifier. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *userId* is null or whitespace. | ### ExchangeTokenAsync Exchanges a token for a new token with different scopes or audience. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ExchangeTokenAsync(string originalToken, string targetAudience, System.Collections.Generic.IEnumerable requestedScopes = null, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `originalToken` | `string` | The original token to exchange. | | `targetAudience` | `string` | The audience for the new token. | | `requestedScopes` | `System.Collections.Generic.IEnumerable?` | The scopes to request for the new token. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the exchanged token. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *originalToken* or *targetAudience* is null or whitespace. | ### GetCachedTokenAsync Gets the cached token for a specific service and user, if available. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task GetCachedTokenAsync(string userId, string targetServiceId, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userId` | `string` | The user identifier. | | `targetServiceId` | `string` | The target service identifier. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the cached token, or null if not found. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *userId* or *targetServiceId* is null or whitespace. | ### GetOnBehalfOfTokenAsync Performs an OAuth2 on-behalf-of flow to get a token for a downstream service. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task GetOnBehalfOfTokenAsync(string originalToken, string targetAudience, Microsoft.OData.Mcp.Authentication.Models.ClientCredentials clientCredentials, System.Collections.Generic.IEnumerable requestedScopes = null, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `originalToken` | `string` | The original user token. | | `targetAudience` | `string` | The audience for the new token. | | `clientCredentials` | `Microsoft.OData.Mcp.Authentication.Models.ClientCredentials` | The client credentials for the on-behalf-of flow. | | `requestedScopes` | `System.Collections.Generic.IEnumerable?` | The scopes to request for the new token. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the on-behalf-of token. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *originalToken* or *targetAudience* is null or whitespace. | | `ArgumentNullException` | Thrown when *clientCredentials* is null. | ### GetTokenForServiceAsync Gets an authentication token for making requests to a specific target service. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task GetTokenForServiceAsync(string originalToken, string targetServiceId, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `originalToken` | `string` | The original user token. | | `targetServiceId` | `string` | The identifier of the target service. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the delegated token. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *originalToken* or *targetServiceId* is null or whitespace. | ### GetTokenForUrlAsync Gets an authentication token for making requests to a target URL. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task GetTokenForUrlAsync(string originalToken, string targetUrl, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `originalToken` | `string` | The original user token. | | `targetUrl` | `string` | The URL of the target service. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the delegated token. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *originalToken* or *targetUrl* is null or whitespace. | ### RefreshTokenAsync Refreshes a delegated token if it supports refresh operations. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task RefreshTokenAsync(Microsoft.OData.Mcp.Authentication.Models.DelegatedToken delegatedToken, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `delegatedToken` | `Microsoft.OData.Mcp.Authentication.Models.DelegatedToken` | The delegated token to refresh. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the refreshed token. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *delegatedToken* is null. | ### RevokeTokenAsync Revokes a delegated token if the target service supports token revocation. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task RevokeTokenAsync(Microsoft.OData.Mcp.Authentication.Models.DelegatedToken delegatedToken, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `delegatedToken` | `Microsoft.OData.Mcp.Authentication.Models.DelegatedToken` | The delegated token to revoke. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *delegatedToken* is null. | ### ValidateTokenForDelegationAsync Validates that a token is suitable for delegation to a specific service. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ValidateTokenForDelegationAsync(string token, string targetServiceId, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `token` | `string` | The token to validate for delegation. | | `targetServiceId` | `string` | The identifier of the target service. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result indicates whether the token is valid for delegation. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *token* or *targetServiceId* is null or whitespace. | # ITokenValidationService Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/ITokenValidationService Provides services for validating JWT tokens and extracting user context. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Services ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Services.ITokenValidationService ``` ## Summary Provides services for validating JWT tokens and extracting user context. ## Remarks This service handles the core token validation logic, including signature verification, claim extraction, and scope validation. It provides a abstraction layer over the underlying JWT validation mechanisms. ## Methods ### ExtractUserContext Extracts the user context from a validated claims principal. #### Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Models.UserContext ExtractUserContext(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal from a validated token. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.UserContext` The user context containing identity and authorization information. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *principal* is null. | ### GetAuthorizationMetadataAsync Gets the authorization metadata from the JWT token for downstream services. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task GetAuthorizationMetadataAsync(string token) ``` #### Parameters | Name | Type | Description | | - | - | - | | `token` | `string` | The JWT token to extract metadata from. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the authorization metadata. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *token* is null or whitespace. | ### GetTokenLifetime Gets the remaining lifetime of a token. #### Syntax ```csharp theme={"dark"} System.Nullable GetTokenLifetime(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal from a validated token. | #### Returns Type: `System.Nullable` The remaining time before the token expires, or null if the token has no expiration. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *principal* is null. | ### HasRequiredScopes Checks if a user has the required scopes for a specific operation. #### Syntax ```csharp theme={"dark"} bool HasRequiredScopes(Microsoft.OData.Mcp.Authentication.Models.UserContext userContext, System.Collections.Generic.IEnumerable requiredScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userContext` | `Microsoft.OData.Mcp.Authentication.Models.UserContext` | The user context to check. | | `requiredScopes` | `System.Collections.Generic.IEnumerable` | The scopes required for the operation. | #### Returns Type: `bool` `true` if the user has at least one of the required scopes; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *userContext* or *requiredScopes* is null. | ### IsTokenExpired Determines if a token is expired based on its claims. #### Syntax ```csharp theme={"dark"} bool IsTokenExpired(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal from a validated token. | #### Returns Type: `bool` `true` if the token is expired; otherwise, `false`. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *principal* is null. | ### ValidateTokenAsync Validates a JWT token and returns the principal if valid. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ValidateTokenAsync(string token, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `token` | `string` | The JWT token to validate. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous validation operation. The task result contains the claims principal if the token is valid, or null if invalid. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *token* is null or whitespace. | ### ValidateTokenAsync Validates a JWT token with additional validation parameters. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ValidateTokenAsync(string token, System.Collections.Generic.Dictionary validationParameters, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `token` | `string` | The JWT token to validate. | | `validationParameters` | `System.Collections.Generic.Dictionary` | Additional validation parameters to apply. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous validation operation. The task result contains the validation result. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *token* is null or whitespace. | | `ArgumentNullException` | Thrown when *validationParameters* is null. | # TokenValidationService Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/TokenValidationService Provides services for validating JWT tokens and extracting user context. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** Microsoft.OData.Mcp.Authentication.Services **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Authentication.Services.TokenValidationService ``` ## Summary Provides services for validating JWT tokens and extracting user context. ## Remarks This service handles JWT token validation using Microsoft's IdentityModel libraries, including automatic discovery of validation keys and comprehensive claim extraction. ## Constructors ### .ctor Initializes a new instance of the [TokenValidationService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/TokenValidationService) class. #### Syntax ```csharp theme={"dark"} public TokenValidationService(Microsoft.Extensions.Options.IOptions options, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `Microsoft.Extensions.Options.IOptions` | The authentication options. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *options* or *logger* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExtractUserContext Extracts the user context from a validated claims principal. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.UserContext ExtractUserContext(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal from a validated token. | #### Returns Type: `Microsoft.OData.Mcp.Authentication.Models.UserContext` The user context containing identity and authorization information. ### GetAuthorizationMetadataAsync Gets the authorization metadata from the JWT token for downstream services. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GetAuthorizationMetadataAsync(string token) ``` #### Parameters | Name | Type | Description | | - | - | - | | `token` | `string` | The JWT token to extract metadata from. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. The task result contains the authorization metadata. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetTokenLifetime Gets the remaining lifetime of a token. #### Syntax ```csharp theme={"dark"} public System.Nullable GetTokenLifetime(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal from a validated token. | #### Returns Type: `System.Nullable` The remaining time before the token expires, or null if the token has no expiration. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasRequiredScopes Checks if a user has the required scopes for a specific operation. #### Syntax ```csharp theme={"dark"} public bool HasRequiredScopes(Microsoft.OData.Mcp.Authentication.Models.UserContext userContext, System.Collections.Generic.IEnumerable requiredScopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userContext` | `Microsoft.OData.Mcp.Authentication.Models.UserContext` | The user context to check. | | `requiredScopes` | `System.Collections.Generic.IEnumerable` | The scopes required for the operation. | #### Returns Type: `bool` `true` if the user has at least one of the required scopes; otherwise, `false`. ### IsTokenExpired Determines if a token is expired based on its claims. #### Syntax ```csharp theme={"dark"} public bool IsTokenExpired(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal from a validated token. | #### Returns Type: `bool` `true` if the token is expired; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### ValidateTokenAsync Validates a JWT token and returns the principal if valid. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ValidateTokenAsync(string token, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `token` | `string` | The JWT token to validate. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous validation operation. The task result contains the claims principal if the token is valid, or null if invalid. ### ValidateTokenAsync Validates a JWT token with additional validation parameters. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ValidateTokenAsync(string token, System.Collections.Generic.Dictionary validationParameters, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `token` | `string` | The JWT token to validate. | | `validationParameters` | `System.Collections.Generic.Dictionary` | Additional validation parameters to apply. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token to cancel the operation. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous validation operation. The task result contains the validation result. ## Related APIs * Microsoft.OData.Mcp.Authentication.Services.ITokenValidationService # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/index Summary of the Microsoft.OData.Mcp.Authentication.Services Namespace ## Types ### Classes | Name | Summary | | - | - | | [TokenValidationService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/TokenValidationService) | Provides services for validating JWT tokens and extracting user context. | ### Interfaces | Name | Summary | | - | - | | [ITokenDelegationService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/ITokenDelegationService) | Provides services for delegating authentication tokens to downstream services. | | [ITokenValidationService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Services/ITokenValidationService) | Provides services for validating JWT tokens and extracting user context. | # AlertRule Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/AlertRule Alert rule definition. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.AlertRule ``` ## Summary Alert rule definition. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public AlertRule() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Metric Gets or sets the metric to monitor. #### Syntax ```csharp theme={"dark"} public string Metric { get; set; } ``` #### Property Value Type: `string` ### Name Gets or sets the rule name. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### Operator Gets or sets the comparison operator. #### Syntax ```csharp theme={"dark"} public string Operator { get; set; } ``` #### Property Value Type: `string` ### Threshold Gets or sets the threshold value. #### Syntax ```csharp theme={"dark"} public double Threshold { get; set; } ``` #### Property Value Type: `double` ## Methods ### Clone Creates a copy of this rule. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.AlertRule Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.AlertRule` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # AlertingConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/AlertingConfiguration Alerting configuration. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration ``` ## Summary Alerting configuration. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public AlertingConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Enabled Gets or sets a value indicating whether alerting is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` ### Rules Gets or sets the alert rules. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Rules { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration` | The configuration to merge. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the alerting configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # ApplicationInsightsConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ApplicationInsightsConfiguration Azure Application Insights configuration. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration ``` ## Summary Azure Application Insights configuration. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ApplicationInsightsConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ConnectionString Gets or sets the Application Insights connection string. #### Syntax ```csharp theme={"dark"} public string ConnectionString { get; set; } ``` #### Property Value Type: `string?` ### Enabled Gets or sets a value indicating whether Application Insights is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` ### InstrumentationKey Gets or sets the instrumentation key (legacy). #### Syntax ```csharp theme={"dark"} public string InstrumentationKey { get; set; } ``` #### Property Value Type: `string?` ### SamplingPercentage Gets or sets the sampling percentage. #### Syntax ```csharp theme={"dark"} public double SamplingPercentage { get; set; } ``` #### Property Value Type: `double` ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration` | The configuration to merge. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the Application Insights configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # BasicAuthenticationCredentials Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/BasicAuthenticationCredentials Basic authentication credentials. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.BasicAuthenticationCredentials ``` ## Summary Basic authentication credentials. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BasicAuthenticationCredentials() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Password Gets or sets the password. #### Syntax ```csharp theme={"dark"} public string Password { get; set; } ``` #### Property Value Type: `string` ### Username Gets or sets the username. #### Syntax ```csharp theme={"dark"} public string Username { get; set; } ``` #### Property Value Type: `string` ## Methods ### Clone Creates a copy of these credentials. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.BasicAuthenticationCredentials Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.BasicAuthenticationCredentials` A new instance with the same values. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the credentials. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # BuildInfo Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/BuildInfo Build information for the MCP server. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.BuildInfo ``` ## Summary Build information for the MCP server. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public BuildInfo() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Branch Gets or sets the branch name from which the build was created. #### Syntax ```csharp theme={"dark"} public string Branch { get; set; } ``` #### Property Value Type: `string?` The source control branch name. ### BuildNumber Gets or sets the build number or identifier. #### Syntax ```csharp theme={"dark"} public string BuildNumber { get; set; } ``` #### Property Value Type: `string?` The build number or identifier from the CI/CD system. ### BuildTimestamp Gets or sets the timestamp when the build was created. #### Syntax ```csharp theme={"dark"} public System.Nullable BuildTimestamp { get; set; } ``` #### Property Value Type: `System.Nullable?` The UTC timestamp of the build. ### CommitHash Gets or sets the commit hash of the source code. #### Syntax ```csharp theme={"dark"} public string CommitHash { get; set; } ``` #### Property Value Type: `string?` The Git commit hash or similar version control identifier. ### Configuration Gets or sets the build configuration (e.g., Debug, Release). #### Syntax ```csharp theme={"dark"} public string Configuration { get; set; } ``` #### Property Value Type: `string?` The build configuration used to compile the server. ### TargetFramework Gets or sets the target framework for which the server was built. #### Syntax ```csharp theme={"dark"} public string TargetFramework { get; set; } ``` #### Property Value Type: `string?` The .NET target framework (e.g., "net8.0", "net9.0"). ## Methods ### Clone Creates a copy of this build information. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.BuildInfo Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.BuildInfo` A new instance with the same values. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # CacheCompressionConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheCompressionConfiguration Configuration for cache compression. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration ``` ## Summary Configuration for cache compression. ## Remarks Cache compression configuration controls how cached data is compressed to reduce memory usage and storage requirements. Compression can significantly reduce cache size at the cost of additional CPU overhead during cache operations. ## Constructors ### .ctor Initializes a new instance of the [CacheCompressionConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheCompressionConfiguration) class. #### Syntax ```csharp theme={"dark"} public CacheCompressionConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Algorithm Gets or sets the compression algorithm to use. #### Syntax ```csharp theme={"dark"} public string Algorithm { get; set; } ``` #### Property Value Type: `string` The name of the compression algorithm. #### Examples Common values: * "gzip": Good balance of compression and speed * "deflate": Similar to gzip but with less overhead * "brotli": Better compression ratio but slower #### Remarks Supported algorithms typically include "gzip", "deflate", and "brotli". Different algorithms offer different trade-offs between compression ratio, speed, and CPU usage. ### CompressionLevel Gets or sets the compression level. #### Syntax ```csharp theme={"dark"} public int CompressionLevel { get; set; } ``` #### Property Value Type: `int` The compression level from 0 (no compression) to 9 (maximum compression). #### Remarks Higher compression levels provide better compression ratios but require more CPU time. Level 6 typically provides a good balance between compression ratio and performance. ### Enabled Gets or sets a value indicating whether cache compression is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` to enable compression; otherwise, `false`. #### Remarks When compression is enabled, cached data will be compressed before storage and decompressed when retrieved. This can significantly reduce memory usage for large cached objects. ### MinimumSize Gets or sets the minimum size in bytes before compression is applied. #### Syntax ```csharp theme={"dark"} public int MinimumSize { get; set; } ``` #### Property Value Type: `int` The minimum size threshold for compression. #### Remarks Small objects may not benefit from compression due to the overhead of the compression algorithm. Objects smaller than this threshold will be stored uncompressed. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration` A new instance with the same settings. ### Disabled Creates a configuration with compression disabled. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration Disabled() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration` A compression configuration with compression disabled. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FastCompression Creates a configuration optimized for fast compression. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration FastCompression() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration` A compression configuration optimized for speed. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MaximumCompression Creates a configuration optimized for maximum compression. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration MaximumCompression() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration` A compression configuration optimized for compression ratio. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration` | The configuration to merge into this one. | #### Remarks All values from the other configuration will override values in this configuration. This allows for complete updates of compression settings. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the compression configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # CacheEvictionPolicy Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheEvictionPolicy Defines the cache eviction policies. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.CacheEvictionPolicy ``` ## Summary Defines the cache eviction policies. ## Remarks Cache eviction policies determine which entries are removed from the cache when size or entry limits are reached. Different policies optimize for different access patterns and performance characteristics. ## Values | Name | Value | Description | | - | - | - | | `LeastRecentlyUsed` | 0 | Least Recently Used (LRU) eviction policy. | | `LeastFrequentlyUsed` | 1 | Least Frequently Used (LFU) eviction policy. | | `FirstInFirstOut` | 2 | First In, First Out (FIFO) eviction policy. | | `Random` | 3 | Random eviction policy. | | `TimeToLive` | 4 | Time-based eviction (shortest TTL first). | # CacheProviderType Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheProviderType Defines the cache provider types. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.CacheProviderType ``` ## Summary Defines the cache provider types. ## Remarks Cache provider types determine the underlying storage mechanism and distribution characteristics of the caching system. Each type offers different trade-offs between performance, persistence, and scalability. ## Values | Name | Value | Description | | - | - | - | | `Memory` | 0 | In-memory cache within the application process. | | `Distributed` | 1 | Distributed cache shared across multiple application instances. | | `Redis` | 2 | Redis-based distributed cache. | | `SqlServer` | 3 | SQL Server-based distributed cache. | | `Custom` | 4 | Custom cache provider implementation. | # CachingConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CachingConfiguration Configuration for metadata and tool caching behavior. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration ``` ## Summary Configuration for metadata and tool caching behavior. ## Remarks Caching configuration controls how long metadata and generated tools are cached to improve performance and reduce load on the underlying OData service. This class provides comprehensive caching options including provider selection, TTL settings, size limits, and advanced features like compression and warming. ## Constructors ### .ctor Initializes a new instance of the [CachingConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CachingConfiguration) class. #### Syntax ```csharp theme={"dark"} public CachingConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Compression Gets or sets the compression configuration for cached data. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration Compression { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration` Configuration for compressing cached data to save memory/storage. #### Remarks Cache compression can significantly reduce memory usage for large cached objects at the cost of additional CPU overhead. ### CustomProperties Gets or sets custom caching properties. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom caching configuration values. #### Remarks Custom properties allow extending the configuration with cache provider-specific settings that don't fit into the standard configuration properties. ### DistributedCache Gets or sets the distributed cache configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration DistributedCache { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration` Configuration for distributed caching across multiple server instances. #### Remarks Distributed caching enables cache sharing between multiple MCP server instances for improved consistency and performance. ### Enabled Gets or sets a value indicating whether caching is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` to enable caching; otherwise, `false`. #### Remarks When caching is disabled, metadata and tools will be regenerated for every request, which can impact performance but ensures the latest data is always used. ### EnableStatistics Gets or sets a value indicating whether to enable cache statistics collection. #### Syntax ```csharp theme={"dark"} public bool EnableStatistics { get; set; } ``` #### Property Value Type: `bool` `true` to collect cache statistics; otherwise, `false`. #### Remarks Cache statistics provide insights into cache hit rates, evictions, and performance metrics for monitoring and optimization. ### EnableWarming Gets or sets a value indicating whether to enable cache warming. #### Syntax ```csharp theme={"dark"} public bool EnableWarming { get; set; } ``` #### Property Value Type: `bool` `true` to pre-populate the cache on startup; otherwise, `false`. #### Remarks Cache warming pre-populates frequently accessed data to improve initial response times after server startup. ### EvictionPolicy Gets or sets the cache eviction policy. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CacheEvictionPolicy EvictionPolicy { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.CacheEvictionPolicy` The policy used to determine which entries to evict when cache limits are reached. #### Remarks Different eviction policies optimize for different access patterns and performance characteristics. ### KeyPrefix Gets or sets the cache key prefix. #### Syntax ```csharp theme={"dark"} public string KeyPrefix { get; set; } ``` #### Property Value Type: `string` A prefix added to all cache keys to avoid collisions. #### Remarks Key prefixes are useful when multiple MCP server instances share the same cache infrastructure. ### MaxEntries Gets or sets the maximum number of cache entries. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxEntries { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum number of entries in the cache, or null for no limit. #### Remarks Entry count limits provide an alternative way to control cache size when individual entry sizes vary significantly. ### MaxSizeMb Gets or sets the maximum size of the cache in megabytes. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxSizeMb { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum cache size in MB, or null for no limit. #### Remarks Cache size limits prevent excessive memory usage. When the limit is reached, older entries will be evicted using the configured eviction policy. ### MetadataTtl Gets or sets the Time-To-Live (TTL) for metadata cache entries. #### Syntax ```csharp theme={"dark"} public System.TimeSpan MetadataTtl { get; set; } ``` #### Property Value Type: `System.TimeSpan` The duration to cache metadata before it expires. #### Remarks Metadata is typically stable and can be cached for longer periods. A shorter TTL ensures faster detection of schema changes. ### ProviderType Gets or sets the cache provider type. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CacheProviderType ProviderType { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.CacheProviderType` The type of cache provider to use. #### Remarks Different cache providers offer different characteristics in terms of persistence, performance, and distributed caching capabilities. ### QueryResultsTtl Gets or sets the Time-To-Live (TTL) for query result cache entries. #### Syntax ```csharp theme={"dark"} public System.TimeSpan QueryResultsTtl { get; set; } ``` #### Property Value Type: `System.TimeSpan` The duration to cache query results before they expire. #### Remarks Query results represent actual data and should typically have shorter TTL values to ensure data freshness. ### ToolsTtl Gets or sets the Time-To-Live (TTL) for generated tools cache entries. #### Syntax ```csharp theme={"dark"} public System.TimeSpan ToolsTtl { get; set; } ``` #### Property Value Type: `System.TimeSpan` The duration to cache generated tools before they expire. #### Remarks Generated tools are derived from metadata and can be cached separately with different TTL values for performance optimization. ### WarmingDelay Gets or sets the cache warming delay after startup. #### Syntax ```csharp theme={"dark"} public System.TimeSpan WarmingDelay { get; set; } ``` #### Property Value Type: `System.TimeSpan` The delay before starting cache warming operations. #### Remarks A startup delay allows the server to fully initialize before beginning resource-intensive cache warming operations. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration` A new instance with the same settings. ### Disabled Creates a configuration with caching disabled. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration Disabled() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration` A caching configuration with all caching disabled. #### Remarks Disabled caching ensures the freshest data is always retrieved at the cost of performance. Useful for debugging or when data consistency is more important than performance. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForDevelopment Creates a configuration optimized for development environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration ForDevelopment() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration` A caching configuration suitable for development. #### Remarks Development configurations use shorter TTLs and smaller cache sizes to ensure faster detection of changes during development cycles. ### ForProduction Creates a configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration ForProduction() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration` A caching configuration suitable for production. #### Remarks Production configurations use longer TTLs, larger cache sizes, and enable advanced features like compression and warming for optimal performance. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadataKey Gets the cache key for a metadata entry. #### Syntax ```csharp theme={"dark"} public string GetMetadataKey(string serviceUrl) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceUrl` | `string` | The OData service URL. | #### Returns Type: `string` The cache key for the metadata. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *serviceUrl* is null or whitespace. | ### GetQueryResultKey Gets the cache key for a query result entry. #### Syntax ```csharp theme={"dark"} public string GetQueryResultKey(string serviceUrl, string queryHash, string userContext = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceUrl` | `string` | The OData service URL. | | `queryHash` | `string` | The hash of the query parameters. | | `userContext` | `string?` | Optional user context for user-specific caching. | #### Returns Type: `string` The cache key for the query result. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *serviceUrl* is null or whitespace. | ### GetToolsKey Gets the cache key for a tools entry. #### Syntax ```csharp theme={"dark"} public string GetToolsKey(string serviceUrl, string optionsHash) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceUrl` | `string` | The OData service URL. | | `optionsHash` | `string` | The hash of the tool generation options. | #### Returns Type: `string` The cache key for the tools. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *serviceUrl* is null or whitespace. | ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration` | The configuration to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the caching configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # CertificateStoreLocation Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CertificateStoreLocation Certificate store locations. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.CertificateStoreLocation ``` ## Summary Certificate store locations. ## Values | Name | Value | Description | | - | - | - | | `CurrentUser` | 0 | Current user certificate store. | | `LocalMachine` | 1 | Local machine certificate store. | # CompressionConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CompressionConfiguration HTTP response compression configuration. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.CompressionConfiguration ``` ## Summary HTTP response compression configuration. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public CompressionConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Algorithms Gets or sets the compression algorithms to use. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Algorithms { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Enabled Gets or sets a value indicating whether compression is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` ### MimeTypes Gets or sets the MIME types to compress. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List MimeTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### MinimumSize Gets or sets the minimum response size to compress. #### Syntax ```csharp theme={"dark"} public int MinimumSize { get; set; } ``` #### Property Value Type: `int` ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CompressionConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CompressionConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.CompressionConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.CompressionConfiguration` | The configuration to merge. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the compression configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # CorsConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CorsConfiguration CORS (Cross-Origin Resource Sharing) configuration. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration ``` ## Summary CORS (Cross-Origin Resource Sharing) configuration. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public CorsConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AllowCredentials Gets or sets a value indicating whether credentials are allowed. #### Syntax ```csharp theme={"dark"} public bool AllowCredentials { get; set; } ``` #### Property Value Type: `bool` ### AllowedHeaders Gets or sets the allowed headers. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List AllowedHeaders { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### AllowedMethods Gets or sets the allowed methods. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List AllowedMethods { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### AllowedOrigins Gets or sets the allowed origins. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List AllowedOrigins { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### Enabled Gets or sets a value indicating whether CORS is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` ### MaxAge Gets or sets the maximum age for preflight requests. #### Syntax ```csharp theme={"dark"} public System.TimeSpan MaxAge { get; set; } ``` #### Property Value Type: `System.TimeSpan` ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration` | The configuration to merge. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the CORS configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # DataProtectionConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/DataProtectionConfiguration Configuration for data protection and encryption settings. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration ``` ## Summary Configuration for data protection and encryption settings. ## Remarks Data protection configuration controls how sensitive data is encrypted and protected within the MCP server. This includes encryption keys, rotation periods, and encryption policies for different data types. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DataProtectionConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### EncryptionKey Gets or sets the encryption key used for data protection. #### Syntax ```csharp theme={"dark"} public string EncryptionKey { get; set; } ``` #### Property Value Type: `string` The base64-encoded encryption key. #### Remarks This key is used for encrypting and decrypting sensitive data. It should be a strong, randomly generated key and kept secure. Consider using key management services in production environments. ### EncryptSensitiveData Gets or sets a value indicating whether sensitive data should be encrypted. #### Syntax ```csharp theme={"dark"} public bool EncryptSensitiveData { get; set; } ``` #### Property Value Type: `bool` `true` to encrypt sensitive data; otherwise, `false`. #### Remarks When enabled, sensitive data such as authentication tokens, API keys, and user credentials will be encrypted before storage or transmission. ### KeyRotationPeriod Gets or sets the period after which encryption keys should be rotated. #### Syntax ```csharp theme={"dark"} public System.TimeSpan KeyRotationPeriod { get; set; } ``` #### Property Value Type: `System.TimeSpan` The time span between key rotations. #### Remarks Regular key rotation is a security best practice that limits the exposure window if a key is compromised. Shorter rotation periods provide better security but require more frequent key management. ## Methods ### Clone Creates a copy of this data protection configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForProduction Creates a data protection configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration ForProduction() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration` A data protection configuration suitable for production use. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another data protection configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration` | The configuration to merge into this one. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the data protection configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # DistributedCacheConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/DistributedCacheConfiguration Configuration for distributed caching. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration ``` ## Summary Configuration for distributed caching. ## Remarks Distributed cache configuration specifies how the MCP server connects to and uses distributed caching services like Redis or SQL Server for sharing cache data across multiple instances. ## Constructors ### .ctor Initializes a new instance of the [DistributedCacheConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/DistributedCacheConfiguration) class. #### Syntax ```csharp theme={"dark"} public DistributedCacheConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ConnectionString Gets or sets the connection string for the distributed cache. #### Syntax ```csharp theme={"dark"} public string ConnectionString { get; set; } ``` #### Property Value Type: `string?` The connection string used to connect to the distributed cache service. #### Examples For Redis: "localhost:6379" For SQL Server: "Server=(localdb)\mssqllocaldb;Database=DistCache;Trusted\_Connection=true;" #### Remarks The format of the connection string depends on the cache provider type. For Redis, this would be a Redis connection string. For SQL Server, this would be a SQL Server connection string. ### DefaultAbsoluteExpiration Gets or sets the default absolute expiration for distributed cache entries. #### Syntax ```csharp theme={"dark"} public System.Nullable DefaultAbsoluteExpiration { get; set; } ``` #### Property Value Type: `System.Nullable?` The maximum time span that cache entries remain valid regardless of access. #### Remarks Absolute expiration ensures that entries are removed from the cache after a fixed period, regardless of how frequently they are accessed. This is useful for ensuring data freshness. ### DefaultSlidingExpiration Gets or sets the default sliding expiration for distributed cache entries. #### Syntax ```csharp theme={"dark"} public System.Nullable DefaultSlidingExpiration { get; set; } ``` #### Property Value Type: `System.Nullable?` The time span that cache entries remain valid after their last access. #### Remarks Sliding expiration resets the expiration time each time an entry is accessed, keeping frequently used items in the cache longer. If not specified, entries will use absolute expiration only. ### InstanceName Gets or sets the instance name for the distributed cache. #### Syntax ```csharp theme={"dark"} public string InstanceName { get; set; } ``` #### Property Value Type: `string?` A unique name identifying this cache instance. #### Remarks The instance name is used to create unique cache keys and separate cache data between different applications or environments sharing the same distributed cache infrastructure. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForRedis Creates a configuration for Redis distributed caching. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration ForRedis(string connectionString, string instanceName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `connectionString` | `string` | The Redis connection string. | | `instanceName` | `string` | The cache instance name. | #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration` A distributed cache configuration for Redis. ### ForSqlServer Creates a configuration for SQL Server distributed caching. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration ForSqlServer(string connectionString, string instanceName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `connectionString` | `string` | The SQL Server connection string. | | `instanceName` | `string` | The cache instance name. | #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration` A distributed cache configuration for SQL Server. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration` | The configuration to merge into this one. | #### Remarks Only non-null and non-empty values from the other configuration will override values in this configuration. This allows for partial updates without losing existing settings. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the distributed cache configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # FeatureFlagsConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/FeatureFlagsConfiguration Configuration for enabling/disabling specific features. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration ``` ## Summary Configuration for enabling/disabling specific features. ## Remarks Feature flags allow selective enabling of functionality for gradual rollouts, A/B testing, or environment-specific configurations without code changes. ## Constructors ### .ctor Initializes a new instance of the [FeatureFlagsConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/FeatureFlagsConfiguration) class. #### Syntax ```csharp theme={"dark"} public FeatureFlagsConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CustomFlags Gets or sets custom feature flag values. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomFlags { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom feature flag names and their enabled status. #### Remarks Custom feature flags allow applications to define their own toggleable features beyond the predefined flags in this configuration. ### EnableAdvancedQuerying Gets or sets a value indicating whether advanced querying features are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableAdvancedQuerying { get; set; } ``` #### Property Value Type: `bool` `true` to enable advanced querying; otherwise, `false`. #### Remarks Advanced querying includes features like complex $filter expressions, custom functions, and sophisticated $expand operations. ### EnableAsyncStreaming Gets or sets a value indicating whether async streaming is enabled. #### Syntax ```csharp theme={"dark"} public bool EnableAsyncStreaming { get; set; } ``` #### Property Value Type: `bool` `true` to enable async streaming; otherwise, `false`. #### Remarks Async streaming allows large result sets to be returned incrementally, improving perceived performance and reducing memory usage. ### EnableBatchOperations Gets or sets a value indicating whether batch operations are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableBatchOperations { get; set; } ``` #### Property Value Type: `bool` `true` to enable batch operations; otherwise, `false`. #### Remarks Batch operations allow multiple operations to be executed in a single request, improving performance but increasing complexity and resource usage. ### EnableBetaApiVersions Gets or sets a value indicating whether beta API versions are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableBetaApiVersions { get; set; } ``` #### Property Value Type: `bool` `true` to enable beta API versions; otherwise, `false`. #### Remarks Beta API versions provide access to new functionality before it becomes generally available, but may be unstable or subject to breaking changes. ### EnableCachingOptimizations Gets or sets a value indicating whether caching optimizations are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableCachingOptimizations { get; set; } ``` #### Property Value Type: `bool` `true` to enable caching optimizations; otherwise, `false`. #### Remarks Caching optimizations include aggressive caching strategies that may improve performance at the cost of data freshness. ### EnableCustomToolExtensions Gets or sets a value indicating whether custom tool extensions are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableCustomToolExtensions { get; set; } ``` #### Property Value Type: `bool` `true` to enable custom tool extensions; otherwise, `false`. #### Remarks Custom tool extensions allow loading additional MCP tools from external assemblies or configuration, extending the server's capabilities. ### EnableDevelopmentEndpoints Gets or sets a value indicating whether development endpoints are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableDevelopmentEndpoints { get; set; } ``` #### Property Value Type: `bool` `true` to enable development-specific endpoints; otherwise, `false`. #### Remarks Development endpoints include features like detailed diagnostics, configuration inspection, and testing utilities that should not be available in production. ### EnableEnhancedSecurity Gets or sets a value indicating whether enhanced security features are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableEnhancedSecurity { get; set; } ``` #### Property Value Type: `bool` `true` to enable enhanced security; otherwise, `false`. #### Remarks Enhanced security features provide additional protection mechanisms that may impact performance or compatibility with some clients. ### EnableExperimentalFeatures Gets or sets a value indicating whether experimental features are enabled. #### Syntax ```csharp theme={"dark"} public bool EnableExperimentalFeatures { get; set; } ``` #### Property Value Type: `bool` `true` to enable experimental features; otherwise, `false`. #### Remarks Experimental features are new or unstable functionality that may change or be removed in future versions. Use with caution in production. ### EnableLegacyCompatibility Gets or sets a value indicating whether legacy compatibility mode is enabled. #### Syntax ```csharp theme={"dark"} public bool EnableLegacyCompatibility { get; set; } ``` #### Property Value Type: `bool` `true` to enable legacy compatibility; otherwise, `false`. #### Remarks Legacy compatibility mode maintains backward compatibility with older OData versions or non-standard implementations at the cost of modern features. ### EnablePerformanceProfiling Gets or sets a value indicating whether performance profiling is enabled. #### Syntax ```csharp theme={"dark"} public bool EnablePerformanceProfiling { get; set; } ``` #### Property Value Type: `bool` `true` to enable performance profiling; otherwise, `false`. #### Remarks Performance profiling collects detailed timing and resource usage information for optimization purposes but adds overhead to request processing. ### EnforceStrictSchemaValidation Gets or sets a value indicating whether schema validation is enforced. #### Syntax ```csharp theme={"dark"} public bool EnforceStrictSchemaValidation { get; set; } ``` #### Property Value Type: `bool` `true` to enforce strict schema validation; otherwise, `false`. #### Remarks Strict schema validation ensures all requests conform exactly to the OData schema but may reject valid requests with minor variations. ### FlagMetadata Gets or sets feature flag metadata. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary FlagMetadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary containing metadata about feature flags. #### Remarks Metadata can include information such as flag descriptions, deprecation notices, rollout percentages, or other contextual information. ## Methods ### AddFlagMetadata Adds metadata for a feature flag. #### Syntax ```csharp theme={"dark"} public void AddFlagMetadata(string flagName, object metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `flagName` | `string` | The name of the feature flag. | | `metadata` | `object` | The metadata object to associate with the flag. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *flagName* is null or whitespace. | ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForDevelopment Creates a configuration optimized for development environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration ForDevelopment() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration` A feature flags configuration suitable for development. ### ForProduction Creates a configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration ForProduction() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration` A feature flags configuration suitable for production. ### GetEnabledFlags Gets all enabled feature flags. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetEnabledFlags() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of enabled feature flag names. ### GetFlagMetadata Gets metadata for a feature flag. #### Syntax ```csharp theme={"dark"} public T GetFlagMetadata(string flagName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `flagName` | `string` | The name of the feature flag. | #### Returns Type: `T?` The metadata object if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the metadata object. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetStatistics Gets feature flag statistics for monitoring and diagnostics. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary GetStatistics() ``` #### Returns Type: `System.Collections.Generic.Dictionary` A dictionary containing feature flag statistics. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### IsEnabled Determines whether a specific feature flag is enabled. #### Syntax ```csharp theme={"dark"} public bool IsEnabled(string flagName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `flagName` | `string` | The name of the feature flag to check. | #### Returns Type: `bool` `true` if the flag is enabled; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration` | The configuration to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### Minimal Creates a minimal configuration with most features disabled. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration Minimal() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration` A feature flags configuration with minimal features enabled. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveCustomFlag Removes a custom feature flag. #### Syntax ```csharp theme={"dark"} public bool RemoveCustomFlag(string flagName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `flagName` | `string` | The name of the feature flag to remove. | #### Returns Type: `bool` `true` if the flag was removed; otherwise, `false`. ### SetCustomFlag Sets the value of a custom feature flag. #### Syntax ```csharp theme={"dark"} public void SetCustomFlag(string flagName, bool enabled) ``` #### Parameters | Name | Type | Description | | - | - | - | | `flagName` | `string` | The name of the feature flag. | | `enabled` | `bool` | Whether the flag should be enabled. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *flagName* is null or whitespace. | ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the feature flags configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation warnings, or empty if the configuration is valid. #### Remarks Feature flags validation focuses on warnings rather than errors, as most combinations are valid but some may indicate misconfigurations. # InputValidationConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/InputValidationConfiguration Configuration for input validation and sanitization. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration ``` ## Summary Configuration for input validation and sanitization. ## Remarks Input validation configuration controls how user-provided data is validated and sanitized before processing. This helps prevent injection attacks, data corruption, and ensures data integrity throughout the application. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public InputValidationConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AllowSpecialCharacters Gets or sets a value indicating whether special characters are allowed in input. #### Syntax ```csharp theme={"dark"} public bool AllowSpecialCharacters { get; set; } ``` #### Property Value Type: `bool` `true` to allow special characters; otherwise, `false`. #### Remarks Special characters can be used in injection attacks but may also be legitimate parts of user data. This setting controls the balance between security and functionality. ### EnableStrictValidation Gets or sets a value indicating whether strict validation is enabled. #### Syntax ```csharp theme={"dark"} public bool EnableStrictValidation { get; set; } ``` #### Property Value Type: `bool` `true` to enable strict validation; otherwise, `false`. #### Remarks Strict validation applies more rigorous rules to input data, rejecting potentially dangerous content. This provides better security but may be more restrictive for legitimate use cases. ### MaxStringLength Gets or sets the maximum allowed length for string inputs. #### Syntax ```csharp theme={"dark"} public int MaxStringLength { get; set; } ``` #### Property Value Type: `int` The maximum string length in characters. #### Remarks String length limits prevent buffer overflow attacks and ensure predictable resource usage. This applies to all string inputs unless overridden by specific field validation rules. ## Methods ### Clone Creates a copy of this input validation configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Lenient Creates an input validation configuration with lenient rules. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration Lenient() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration` A validation configuration suitable for environments requiring flexible input handling. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another input validation configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration` | The configuration to merge into this one. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Strict Creates an input validation configuration with strict rules. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration Strict() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration` A validation configuration suitable for high-security environments. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the input validation configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # IpRestrictionConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/IpRestrictionConfiguration Configuration for IP address restrictions and access control. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration ``` ## Summary Configuration for IP address restrictions and access control. ## Remarks IP restriction configuration allows controlling access to the MCP server based on client IP addresses. This provides an additional security layer by allowing or blocking requests from specific IP ranges. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IpRestrictionConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AllowedIpRanges Gets or sets the list of allowed IP address ranges. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List AllowedIpRanges { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of IP ranges in CIDR notation that are allowed access. #### Remarks IP ranges should be specified in CIDR notation (e.g., "192.168.1.0/24"). Individual IP addresses can be specified with /32 suffix (e.g., "192.168.1.100/32"). ### BlockedIpRanges Gets or sets the list of blocked IP address ranges. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List BlockedIpRanges { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of IP ranges in CIDR notation that are blocked from access. #### Remarks Blocked IP ranges take precedence over allowed ranges. If an IP address matches both an allowed and blocked range, access will be denied. ### Enabled Gets or sets a value indicating whether IP restrictions are enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` to enable IP restrictions; otherwise, `false`. #### Remarks When enabled, only requests from allowed IP ranges will be accepted, and requests from blocked IP ranges will be rejected. ## Methods ### Clone Creates a copy of this IP restriction configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another IP restriction configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration` | The configuration to merge into this one. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the IP restriction configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # LogFilter Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/LogFilter Log filter configuration. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.LogFilter ``` ## Summary Log filter configuration. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public LogFilter() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Category Gets or sets the log category. #### Syntax ```csharp theme={"dark"} public string Category { get; set; } ``` #### Property Value Type: `string` ### Level Gets or sets the minimum log level. #### Syntax ```csharp theme={"dark"} public string Level { get; set; } ``` #### Property Value Type: `string` ## Methods ### Clone Creates a copy of this filter. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.LogFilter Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.LogFilter` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the log filter. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # McpDeploymentMode Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpDeploymentMode Defines the deployment modes for MCP servers. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode ``` ## Summary Defines the deployment modes for MCP servers. ## Values | Name | Value | Description | | - | - | - | | `Sidecar` | 0 | Sidecar deployment runs as a separate service alongside the OData service. | | `Middleware` | 1 | Middleware deployment integrates directly into the host ASP.NET Core application. | | `Hybrid` | 2 | Hybrid deployment combines aspects of both sidecar and middleware modes. | # McpServerConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpServerConfiguration Unified configuration for MCP servers supporting both sidecar and middleware deployment modes. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ``` ## Summary Unified configuration for MCP servers supporting both sidecar and middleware deployment modes. ## Remarks This configuration provides a single, unified interface for configuring MCP servers regardless of deployment mode. It supports both standalone (sidecar) and embedded (middleware) deployment patterns with appropriate defaults for each scenario. ## Constructors ### .ctor Initializes a new instance of the [McpServerConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpServerConfiguration) class. #### Syntax ```csharp theme={"dark"} public McpServerConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Authentication Gets or sets the authentication configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions Authentication { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions` Configuration for user authentication and token validation. #### Remarks Authentication configuration controls how users are authenticated and how tokens are validated and forwarded to the underlying OData service. ### Caching Gets or sets the caching configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration Caching { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration` Configuration for metadata and tool caching behavior. #### Remarks Caching configuration controls how long metadata and generated tools are cached to improve performance and reduce load on the underlying OData service. ### CustomProperties Gets or sets custom configuration properties. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom configuration values. #### Remarks Custom properties allow extending the configuration with application-specific settings that don't fit into the standard configuration categories. ### DeploymentMode Gets or sets the deployment mode for the MCP server. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode DeploymentMode { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode` The deployment mode determining how the server operates. #### Remarks The deployment mode affects how the server discovers metadata, handles authentication, and exposes endpoints. Each mode has different configuration requirements and behaviors. ### FeatureFlags Gets or sets the feature flags configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration FeatureFlags { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration` Configuration for enabling/disabling specific features. #### Remarks Feature flags allow selective enabling of functionality for gradual rollouts, A/B testing, or environment-specific configurations. ### Monitoring Gets or sets the logging and monitoring configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration Monitoring { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration` Configuration for logging, metrics, and health monitoring. #### Remarks Monitoring configuration controls what information is logged, how metrics are collected, and what health checks are performed. ### Network Gets or sets the network and transport configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration Network { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration` Configuration for network endpoints, ports, and transport protocols. #### Remarks Network configuration specifies how the MCP server exposes its endpoints and communicates with clients and the underlying OData service. ### ODataService Gets or sets the OData service configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration ODataService { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration` Configuration for connecting to and interacting with OData services. #### Remarks This configuration specifies how the MCP server discovers and communicates with the underlying OData service, including metadata endpoints and authentication. ### Security Gets or sets the security configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration Security { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration` Configuration for security policies and restrictions. #### Remarks Security configuration includes CORS policies, rate limiting, request size limits, and other security-related settings. ### ServerInfo Gets or sets the server information. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.McpServerInfo ServerInfo { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.McpServerInfo` Basic information about the MCP server instance. #### Remarks This information is exposed through the server info endpoint and helps clients understand the capabilities and version of the server. ### ToolGeneration Gets or sets the tool generation configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions ToolGeneration { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions` Options controlling how MCP tools are generated from OData metadata. #### Remarks Tool generation options determine which operations are exposed as MCP tools, how they are named, and what authorization requirements they have. ## Methods ### ApplyEnvironmentOverrides Applies environment-specific overrides to the configuration. #### Syntax ```csharp theme={"dark"} public void ApplyEnvironmentOverrides(string environment) ``` #### Parameters | Name | Type | Description | | - | - | - | | `environment` | `string` | The environment name (e.g., "Development", "Production"). | ### Clone Creates a deep copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration` A new configuration instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForDevelopment Creates a configuration optimized for development environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForDevelopment(Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode deploymentMode = 1) ``` #### Parameters | Name | Type | Description | | - | - | - | | `deploymentMode` | `Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode` | The deployment mode for development. | #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration` A configuration instance with development-friendly settings. ### ForMiddleware Creates a configuration optimized for middleware deployment. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForMiddleware(string basePath = "/mcp") ``` #### Parameters | Name | Type | Description | | - | - | - | | `basePath` | `string` | The base path for MCP endpoints within the host application. | #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration` A configuration instance optimized for middleware deployment. ### ForProduction Creates a configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForProduction(Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode deploymentMode = 0) ``` #### Parameters | Name | Type | Description | | - | - | - | | `deploymentMode` | `Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode` | The deployment mode for production. | #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration` A configuration instance with production-optimized settings. ### ForSidecar Creates a configuration optimized for sidecar deployment. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForSidecar(string odataServiceUrl) ``` #### Parameters | Name | Type | Description | | - | - | - | | `odataServiceUrl` | `string` | The URL of the OData service to integrate with. | #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration` A configuration instance optimized for sidecar deployment. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *odataServiceUrl* is null or whitespace. | ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetStatistics Gets configuration statistics for monitoring and diagnostics. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary GetStatistics() ``` #### Returns Type: `System.Collections.Generic.Dictionary` A dictionary containing configuration statistics. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration` | The configuration to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the configuration for completeness and consistency. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # McpServerInfo Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpServerInfo Basic information about an MCP server instance. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.McpServerInfo ``` ## Summary Basic information about an MCP server instance. ## Remarks This information is used for identification, documentation, and client discovery. It's exposed through the server info endpoint and helps clients understand the capabilities and characteristics of the MCP server. ## Constructors ### .ctor Initializes a new instance of the [McpServerInfo](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpServerInfo) class. #### Syntax ```csharp theme={"dark"} public McpServerInfo() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BuildInfo Gets or sets the build information for the server. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.BuildInfo BuildInfo { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.BuildInfo?` Information about the build that created this server instance. #### Remarks Build information helps with troubleshooting and ensures the correct version is deployed in different environments. ### Capabilities Gets or sets the server capabilities. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Capabilities { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A list of capabilities supported by the server. #### Remarks Capabilities help clients understand what features are available and how they can interact with the server. ### Contact Gets or sets the contact information for support. #### Syntax ```csharp theme={"dark"} public string Contact { get; set; } ``` #### Property Value Type: `string?` Contact information such as email, URL, or phone number. #### Remarks Contact information provides users with a way to get help or report issues with the MCP server. ### Description Gets or sets the description of the MCP server. #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string` A detailed description of the server's purpose and capabilities. #### Remarks The description helps users understand what the server provides and how it can be used in their applications. ### DocumentationUrl Gets or sets the URL to the server's documentation. #### Syntax ```csharp theme={"dark"} public string DocumentationUrl { get; set; } ``` #### Property Value Type: `string?` A URL pointing to comprehensive documentation. #### Remarks Documentation URL provides users with detailed information about how to use and configure the MCP server. ### InstanceId Gets or sets the server instance identifier. #### Syntax ```csharp theme={"dark"} public string InstanceId { get; set; } ``` #### Property Value Type: `string` A unique identifier for this server instance. #### Remarks Instance ID helps distinguish between multiple instances of the same server type and is useful for monitoring and debugging. ### License Gets or sets the license under which the server is distributed. #### Syntax ```csharp theme={"dark"} public string License { get; set; } ``` #### Property Value Type: `string?` The license identifier or description. #### Remarks License information helps users understand the terms under which they can use the MCP server. ### McpProtocolVersion Gets or sets the supported MCP protocol version. #### Syntax ```csharp theme={"dark"} public string McpProtocolVersion { get; set; } ``` #### Property Value Type: `string` The version of the MCP protocol supported by this server. #### Remarks Protocol version information helps clients determine if they are compatible with the server's implementation. ### Metadata Gets or sets additional metadata about the server. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom metadata key-value pairs. #### Remarks Custom metadata allows extending the server information with application-specific details that don't fit into standard properties. ### Name Gets or sets the display name of the MCP server. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` A human-readable name for the server. #### Remarks This name is displayed in client interfaces and should clearly identify the purpose or domain of the MCP server. ### RepositoryUrl Gets or sets the URL to the server's source code repository. #### Syntax ```csharp theme={"dark"} public string RepositoryUrl { get; set; } ``` #### Property Value Type: `string?` A URL pointing to the source code repository. #### Remarks Repository URL allows users to examine the source code, report issues, or contribute to the development of the MCP server. ### StartedAt Gets or sets the timestamp when the server was started. #### Syntax ```csharp theme={"dark"} public System.DateTime StartedAt { get; set; } ``` #### Property Value Type: `System.DateTime` The UTC timestamp when the server instance was created. #### Remarks Start time provides information about server uptime and can be useful for monitoring and diagnostics. ### Vendor Gets or sets the vendor or organization that created the server. #### Syntax ```csharp theme={"dark"} public string Vendor { get; set; } ``` #### Property Value Type: `string?` The name of the vendor or organization. #### Remarks Vendor information helps with support and identification of the server implementation. ### Version Gets or sets the version of the MCP server. #### Syntax ```csharp theme={"dark"} public string Version { get; set; } ``` #### Property Value Type: `string` The semantic version of the server instance. #### Remarks Version information helps clients determine compatibility and should follow semantic versioning principles. ## Methods ### AddCapability Adds a capability to the server. #### Syntax ```csharp theme={"dark"} public void AddCapability(string capability) ``` #### Parameters | Name | Type | Description | | - | - | - | | `capability` | `string` | The capability to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *capability* is null or whitespace. | ### AddMetadata Adds metadata to the server information. #### Syntax ```csharp theme={"dark"} public void AddMetadata(string key, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | | `value` | `object` | The metadata value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### Clone Creates a copy of this server information. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.McpServerInfo Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.McpServerInfo` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadata Gets metadata value by key. #### Syntax ```csharp theme={"dark"} public T GetMetadata(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | #### Returns Type: `T?` The metadata value if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the metadata value. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### GetUptime Gets the server uptime. #### Syntax ```csharp theme={"dark"} public System.TimeSpan GetUptime() ``` #### Returns Type: `System.TimeSpan` The time elapsed since the server was started. ### HasCapability Determines whether the server has the specified capability. #### Syntax ```csharp theme={"dark"} public bool HasCapability(string capability) ``` #### Parameters | Name | Type | Description | | - | - | - | | `capability` | `string` | The capability to check for. | #### Returns Type: `bool` `true` if the server has the capability; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another server info into this one, with the other taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.McpServerInfo other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.McpServerInfo` | The server info to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveCapability Removes a capability from the server. #### Syntax ```csharp theme={"dark"} public bool RemoveCapability(string capability) ``` #### Parameters | Name | Type | Description | | - | - | - | | `capability` | `string` | The capability to remove. | #### Returns Type: `bool` `true` if the capability was removed; otherwise, `false`. ### ToString Returns a string representation of the server information. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the server information. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the server information for completeness and correctness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the information is valid. # MetricDefinition Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MetricDefinition Custom metric definition. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.MetricDefinition ``` ## Summary Custom metric definition. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public MetricDefinition() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Description Gets or sets the metric description. #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string` ### Name Gets or sets the metric name. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` ### Tags Gets or sets the metric tags. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Tags { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### Type Gets or sets the metric type. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.MetricType Type { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.MetricType` ### Unit Gets or sets the metric unit. #### Syntax ```csharp theme={"dark"} public string Unit { get; set; } ``` #### Property Value Type: `string?` ## Methods ### Clone Creates a copy of this definition. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.MetricDefinition Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.MetricDefinition` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the metric definition. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # MetricType Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MetricType Defines the metric types. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.MetricType ``` ## Summary Defines the metric types. ## Values | Name | Value | Description | | - | - | - | | `Counter` | 0 | Counter metric that only increases. | | `Gauge` | 1 | Gauge metric that can increase or decrease. | | `Histogram` | 2 | Histogram metric for measuring distributions. | | `Summary` | 3 | Summary metric with quantiles. | # MonitoringConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MonitoringConfiguration Configuration for logging, metrics, and health monitoring. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration ``` ## Summary Configuration for logging, metrics, and health monitoring. ## Remarks Monitoring configuration controls what information is logged, how metrics are collected, and what health checks are performed for operational visibility. ## Constructors ### .ctor Initializes a new instance of the [MonitoringConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MonitoringConfiguration) class. #### Syntax ```csharp theme={"dark"} public MonitoringConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Alerting Gets or sets the alerting configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration Alerting { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration` Configuration for automated alerts based on metrics and logs. #### Remarks Alerting configuration defines when and how to notify operations teams about system issues or performance degradations. ### ApplicationInsights Gets or sets the application insights configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration ApplicationInsights { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration` Configuration for Azure Application Insights integration. #### Remarks Application Insights provides comprehensive application performance monitoring and analytics for Azure-hosted applications. ### CustomMetrics Gets or sets the custom metric definitions. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List CustomMetrics { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of custom metrics to collect. #### Remarks Custom metrics allow tracking application-specific measurements beyond the standard performance metrics. ### CustomProperties Gets or sets custom monitoring properties. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom monitoring configuration values. #### Remarks Custom properties allow extending the configuration with monitoring system-specific settings that don't fit into the standard configuration properties. ### EnableHealthChecks Gets or sets a value indicating whether to enable health checks. #### Syntax ```csharp theme={"dark"} public bool EnableHealthChecks { get; set; } ``` #### Property Value Type: `bool` `true` to enable health check endpoints; otherwise, `false`. #### Remarks Health checks provide automated monitoring of service health status and can be used by load balancers and monitoring systems. ### EnableMetrics Gets or sets a value indicating whether to enable performance metrics collection. #### Syntax ```csharp theme={"dark"} public bool EnableMetrics { get; set; } ``` #### Property Value Type: `bool` `true` to collect performance metrics; otherwise, `false`. #### Remarks Performance metrics include response times, throughput, error rates, and other operational metrics useful for monitoring and alerting. ### EnableStructuredLogging Gets or sets a value indicating whether to enable structured logging. #### Syntax ```csharp theme={"dark"} public bool EnableStructuredLogging { get; set; } ``` #### Property Value Type: `bool` `true` to enable structured logging; otherwise, `false`. #### Remarks Structured logging outputs log messages in a structured format (like JSON) that can be easily parsed by log aggregation systems. ### EnableTracing Gets or sets a value indicating whether to enable distributed tracing. #### Syntax ```csharp theme={"dark"} public bool EnableTracing { get; set; } ``` #### Property Value Type: `bool` `true` to enable distributed tracing; otherwise, `false`. #### Remarks Distributed tracing tracks requests across multiple services and provides end-to-end visibility in microservice architectures. ### HealthCheckInterval Gets or sets the health check interval. #### Syntax ```csharp theme={"dark"} public System.TimeSpan HealthCheckInterval { get; set; } ``` #### Property Value Type: `System.TimeSpan` The interval between health check executions. #### Remarks More frequent health checks provide faster failure detection but increase system load. ### HealthCheckTimeout Gets or sets the health check timeout. #### Syntax ```csharp theme={"dark"} public System.TimeSpan HealthCheckTimeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The maximum time to wait for health check completion. #### Remarks Health checks that take longer than this timeout will be considered failed. ### LogFilters Gets or sets the log filters. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List LogFilters { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of filters to apply to log messages. #### Remarks Log filters can suppress noisy log messages or enhance logging for specific components or scenarios. ### LogLevel Gets or sets the minimum logging level. #### Syntax ```csharp theme={"dark"} public string LogLevel { get; set; } ``` #### Property Value Type: `string` The minimum level of log messages to record. #### Remarks Log levels follow standard .NET logging conventions: Trace, Debug, Information, Warning, Error, Critical. Lower levels include all higher levels. ### LogRequestResponse Gets or sets a value indicating whether to log request/response details. #### Syntax ```csharp theme={"dark"} public bool LogRequestResponse { get; set; } ``` #### Property Value Type: `bool` `true` to log HTTP request and response details; otherwise, `false`. #### Remarks Request/response logging provides detailed information about HTTP traffic but can impact performance and may log sensitive information. ### LogSensitiveData Gets or sets a value indicating whether to log sensitive data. #### Syntax ```csharp theme={"dark"} public bool LogSensitiveData { get; set; } ``` #### Property Value Type: `bool` `true` to include sensitive data in logs; otherwise, `false`. #### Remarks Sensitive data includes authentication tokens, personal information, and other confidential data. This should be disabled in production environments. ### MetricsInterval Gets or sets the metrics collection interval. #### Syntax ```csharp theme={"dark"} public System.TimeSpan MetricsInterval { get; set; } ``` #### Property Value Type: `System.TimeSpan` The interval between metrics collection cycles. #### Remarks More frequent collection provides better visibility but increases overhead. The optimal interval depends on your monitoring requirements. ### OpenTelemetry Gets or sets the OpenTelemetry configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration OpenTelemetry { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration` Configuration for OpenTelemetry observability. #### Remarks OpenTelemetry provides standardized observability with metrics, logs, and traces that can be exported to various monitoring systems. ### TracingSamplingRate Gets or sets the tracing sampling rate. #### Syntax ```csharp theme={"dark"} public double TracingSamplingRate { get; set; } ``` #### Property Value Type: `double` The percentage of requests to trace (0.0 to 1.0). #### Remarks Sampling reduces the overhead of tracing by only capturing a percentage of requests. A value of 1.0 traces all requests. ## Methods ### AddCustomMetric Adds a custom metric definition. #### Syntax ```csharp theme={"dark"} public void AddCustomMetric(string name, Microsoft.OData.Mcp.Core.Configuration.MetricType type, string description, string unit = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The metric name. | | `type` | `Microsoft.OData.Mcp.Core.Configuration.MetricType` | The metric type. | | `description` | `string` | The metric description. | | `unit` | `string?` | The metric unit. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* is null or whitespace. | ### AddLogFilter Adds a log filter. #### Syntax ```csharp theme={"dark"} public void AddLogFilter(string category, string level) ``` #### Parameters | Name | Type | Description | | - | - | - | | `category` | `string` | The log category to filter. | | `level` | `string` | The minimum log level for the category. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *category* is null or whitespace. | ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForDevelopment Creates a configuration optimized for development environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration ForDevelopment() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration` A monitoring configuration suitable for development. ### ForProduction Creates a configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration ForProduction() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration` A monitoring configuration suitable for production. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration` | The configuration to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### Minimal Creates a minimal monitoring configuration. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration Minimal() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration` A monitoring configuration with minimal overhead. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the monitoring configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # NetworkConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/NetworkConfiguration Configuration for network endpoints, ports, and transport protocols. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration ``` ## Summary Configuration for network endpoints, ports, and transport protocols. ## Remarks Network configuration specifies how the MCP server exposes its endpoints and communicates with clients. The configuration varies based on deployment mode. ## Constructors ### .ctor Initializes a new instance of the [NetworkConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/NetworkConfiguration) class. #### Syntax ```csharp theme={"dark"} public NetworkConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BasePath Gets or sets the base path for MCP endpoints. #### Syntax ```csharp theme={"dark"} public string BasePath { get; set; } ``` #### Property Value Type: `string` The base path prefix for all MCP endpoints (e.g., "/mcp", "/api/mcp"). #### Remarks All MCP endpoints will be prefixed with this path. This allows hosting MCP endpoints alongside other application endpoints. ### Compression Gets or sets the compression configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CompressionConfiguration Compression { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.CompressionConfiguration` Configuration for HTTP response compression. #### Remarks Compression can reduce bandwidth usage for large responses. ### ConnectionTimeout Gets or sets the connection timeout. #### Syntax ```csharp theme={"dark"} public System.TimeSpan ConnectionTimeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The maximum time to wait for new connections to be established. #### Remarks Connections that take longer than this timeout will be rejected. ### Cors Gets or sets the CORS configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration Cors { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration` Configuration for Cross-Origin Resource Sharing. #### Remarks CORS configuration allows web applications from different domains to access the MCP server endpoints. ### CustomProperties Gets or sets custom network properties. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom network configuration values. #### Remarks Custom properties allow extending the configuration with deployment-specific network settings. ### EnableHttps Gets or sets a value indicating whether to enable HTTPS. #### Syntax ```csharp theme={"dark"} public bool EnableHttps { get; set; } ``` #### Property Value Type: `bool` `true` to enable HTTPS; otherwise, `false`. #### Remarks For production deployments, HTTPS should be enabled for security. Development environments may disable HTTPS for simplicity. ### Host Gets or sets the host address to bind to. #### Syntax ```csharp theme={"dark"} public string Host { get; set; } ``` #### Property Value Type: `string` The host address or hostname (e.g., "localhost", "0.0.0.0", "example.com"). #### Remarks For sidecar deployments, this determines the network interface to bind to. For middleware deployments, this is typically inherited from the host application. ### HttpsPort Gets or sets the HTTPS port when HTTPS is enabled. #### Syntax ```csharp theme={"dark"} public System.Nullable HttpsPort { get; set; } ``` #### Property Value Type: `System.Nullable` The HTTPS port number, or null to use default (443). #### Remarks This is only used when EnableHttps is true and in sidecar deployment mode. ### KeepAliveTimeout Gets or sets the keep-alive timeout. #### Syntax ```csharp theme={"dark"} public System.TimeSpan KeepAliveTimeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The maximum time to keep idle connections alive. #### Remarks Idle connections will be closed after this timeout to free resources. ### MaxConcurrentConnections Gets or sets the maximum number of concurrent connections. #### Syntax ```csharp theme={"dark"} public int MaxConcurrentConnections { get; set; } ``` #### Property Value Type: `int` The maximum number of concurrent client connections. #### Remarks This helps prevent resource exhaustion from too many simultaneous connections. ### MaxRequestBodySize Gets or sets the maximum request body size. #### Syntax ```csharp theme={"dark"} public long MaxRequestBodySize { get; set; } ``` #### Property Value Type: `long` The maximum size in bytes for HTTP request bodies. #### Remarks Requests larger than this size will be rejected to prevent memory exhaustion. ### Port Gets or sets the port number to listen on. #### Syntax ```csharp theme={"dark"} public System.Nullable Port { get; set; } ``` #### Property Value Type: `System.Nullable` The TCP port number, or null to use the host application's port. #### Remarks For sidecar deployments, this is the port the MCP server will listen on. For middleware deployments, this should typically be null to inherit from the host. ### RequestTimeout Gets or sets the request timeout. #### Syntax ```csharp theme={"dark"} public System.TimeSpan RequestTimeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The maximum time to wait for request processing. #### Remarks Requests that take longer than this timeout will be cancelled. ### Ssl Gets or sets the SSL certificate configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.SslConfiguration Ssl { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.SslConfiguration` Configuration for SSL/TLS certificates. #### Remarks This configuration is used when HTTPS is enabled in sidecar deployment mode. ### UseHostConfiguration Gets or sets a value indicating whether to use the host application's network configuration. #### Syntax ```csharp theme={"dark"} public bool UseHostConfiguration { get; set; } ``` #### Property Value Type: `bool` `true` to inherit host configuration; otherwise, `false`. #### Remarks For middleware deployments, this should typically be true to inherit the host application's network settings. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetBaseUrl Gets the base URL for the MCP server. #### Syntax ```csharp theme={"dark"} public string GetBaseUrl(string scheme = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `scheme` | `string?` | The URL scheme to use (http or https). | #### Returns Type: `string` The base URL for the MCP server. ### GetEndpointUrl Gets the full URL for an MCP endpoint. #### Syntax ```csharp theme={"dark"} public string GetEndpointUrl(string endpoint, string scheme = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `endpoint` | `string` | The endpoint path (e.g., "tools", "metadata"). | | `scheme` | `string?` | The URL scheme to use (http or https). | #### Returns Type: `string` The complete URL for the endpoint. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration` | The configuration to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the network configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate(Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode deploymentMode) ``` #### Parameters | Name | Type | Description | | - | - | - | | `deploymentMode` | `Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode` | The deployment mode for context-specific validation. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # OAuth2Configuration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/OAuth2Configuration OAuth2 configuration for client credentials flow. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.OAuth2Configuration ``` ## Summary OAuth2 configuration for client credentials flow. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public OAuth2Configuration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ClientId Gets or sets the client ID. #### Syntax ```csharp theme={"dark"} public string ClientId { get; set; } ``` #### Property Value Type: `string` ### ClientSecret Gets or sets the client secret. #### Syntax ```csharp theme={"dark"} public string ClientSecret { get; set; } ``` #### Property Value Type: `string` ### Scopes Gets or sets the OAuth2 scopes to request. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Scopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` ### TokenEndpoint Gets or sets the OAuth2 token endpoint URL. #### Syntax ```csharp theme={"dark"} public string TokenEndpoint { get; set; } ``` #### Property Value Type: `string` ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.OAuth2Configuration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.OAuth2Configuration` A new instance with the same values. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the OAuth2 configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # ODataAuthenticationConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataAuthenticationConfiguration Authentication configuration for connecting to OData services. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration ``` ## Summary Authentication configuration for connecting to OData services. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataAuthenticationConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ApiKey Gets or sets the API key for API key authentication. #### Syntax ```csharp theme={"dark"} public string ApiKey { get; set; } ``` #### Property Value Type: `string?` The API key value. ### ApiKeyHeader Gets or sets the API key header name. #### Syntax ```csharp theme={"dark"} public string ApiKeyHeader { get; set; } ``` #### Property Value Type: `string` The name of the header to include the API key in. ### BasicAuth Gets or sets the basic authentication credentials. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.BasicAuthenticationCredentials BasicAuth { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.BasicAuthenticationCredentials?` The username and password for basic authentication. ### BearerToken Gets or sets the bearer token for bearer token authentication. #### Syntax ```csharp theme={"dark"} public string BearerToken { get; set; } ``` #### Property Value Type: `string?` The bearer token value. ### OAuth2 Gets or sets the OAuth2 configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.OAuth2Configuration OAuth2 { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.OAuth2Configuration?` Configuration for OAuth2 client credentials flow. ### Type Gets or sets the authentication type for the OData service. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationType Type { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationType?` The type of authentication to use when connecting to the OData service. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration` | The configuration to merge. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the authentication configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # ODataAuthenticationType Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataAuthenticationType Defines the authentication types for OData services. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationType ``` ## Summary Defines the authentication types for OData services. ## Values | Name | Value | Description | | - | - | - | | `None` | 0 | No authentication required. | | `ApiKey` | 1 | API key authentication using a custom header. | | `Bearer` | 2 | Bearer token authentication using the Authorization header. | | `Basic` | 3 | Basic authentication using username and password. | | `OAuth2` | 4 | OAuth2 client credentials flow. | # ODataServiceConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataServiceConfiguration Configuration for connecting to and interacting with OData services. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration ``` ## Summary Configuration for connecting to and interacting with OData services. ## Remarks This configuration specifies how the MCP server discovers and communicates with the underlying OData service, including metadata endpoints, authentication, and operational parameters. ## Constructors ### .ctor Initializes a new instance of the [ODataServiceConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataServiceConfiguration) class. #### Syntax ```csharp theme={"dark"} public ODataServiceConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Authentication Gets or sets the authentication configuration for the OData service. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration Authentication { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration` Configuration for authenticating with the OData service. #### Remarks This configuration specifies how the MCP server authenticates with the underlying OData service when making requests on behalf of users. ### AutoDiscoverMetadata Gets or sets a value indicating whether to automatically discover metadata. #### Syntax ```csharp theme={"dark"} public bool AutoDiscoverMetadata { get; set; } ``` #### Property Value Type: `bool` `true` to automatically fetch and parse metadata; otherwise, `false`. #### Remarks When enabled, the MCP server will automatically fetch metadata from the configured endpoint and generate tools based on the discovered schema. ### BaseUrl Gets or sets the base URL of the OData service. #### Syntax ```csharp theme={"dark"} public string BaseUrl { get; set; } ``` #### Property Value Type: `string?` The root URL of the OData service. #### Remarks For sidecar deployments, this is the external URL of the OData service. For middleware deployments, this can be null to use the host application's base URL. ### CustomProperties Gets or sets custom configuration properties. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom configuration values. #### Remarks Custom properties allow extending the configuration with service-specific settings that don't fit into the standard configuration properties. ### DefaultHeaders Gets or sets the default headers to include in OData requests. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary DefaultHeaders { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of header name-value pairs to include in all requests. #### Remarks These headers will be added to all HTTP requests made to the OData service and can be used for custom authentication, tracing, or service identification. ### FollowNextLinks Gets or sets a value indicating whether to follow next links in paged results. #### Syntax ```csharp theme={"dark"} public bool FollowNextLinks { get; set; } ``` #### Property Value Type: `bool` `true` to automatically follow next links; otherwise, `false`. #### Remarks When enabled, the MCP server will automatically follow OData next links to retrieve additional pages of results. ### MaxPages Gets or sets the maximum number of pages to follow. #### Syntax ```csharp theme={"dark"} public int MaxPages { get; set; } ``` #### Property Value Type: `int` The maximum number of result pages to retrieve. #### Remarks This setting prevents infinite loops when following next links and limits the total amount of data retrieved in a single operation. ### MaxPageSize Gets or sets the maximum page size for query results. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxPageSize { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum number of entities to return in a single query response. #### Remarks This setting helps prevent excessively large responses that could impact performance or memory usage. Set to null for no limit. ### MaxRetryAttempts Gets or sets the maximum number of retry attempts for failed requests. #### Syntax ```csharp theme={"dark"} public int MaxRetryAttempts { get; set; } ``` #### Property Value Type: `int` The number of retry attempts for failed HTTP requests. #### Remarks When requests to the OData service fail due to transient errors, the MCP server will retry up to this number of times. ### MetadataPath Gets or sets the path to the OData metadata endpoint. #### Syntax ```csharp theme={"dark"} public string MetadataPath { get; set; } ``` #### Property Value Type: `string` The relative path to the metadata endpoint (typically "/\$metadata"). #### Remarks This path is appended to the base URL to construct the full metadata endpoint URL. The metadata endpoint must return CSDL (Common Schema Definition Language) XML. ### RefreshInterval Gets or sets the interval for refreshing metadata. #### Syntax ```csharp theme={"dark"} public System.TimeSpan RefreshInterval { get; set; } ``` #### Property Value Type: `System.TimeSpan` The time interval between metadata refresh attempts. #### Remarks The MCP server will periodically refresh metadata to detect schema changes. Set to [Zero](https://learn.microsoft.com/dotnet/api/system.timespan.zero) to disable automatic refresh. ### RequestTimeout Gets or sets the timeout for HTTP requests to the OData service. #### Syntax ```csharp theme={"dark"} public System.TimeSpan RequestTimeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The maximum time to wait for HTTP responses. #### Remarks This timeout applies to all HTTP requests made to the OData service, including metadata discovery and data operations. ### RetryDelay Gets or sets the base delay for retry attempts. #### Syntax ```csharp theme={"dark"} public System.TimeSpan RetryDelay { get; set; } ``` #### Property Value Type: `System.TimeSpan` The initial delay before the first retry attempt. #### Remarks Subsequent retries will use exponential backoff based on this initial delay. ### SupportedODataVersions Gets or sets the supported OData versions. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List SupportedODataVersions { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A list of OData versions supported by the service. #### Remarks This information helps the MCP server understand which OData features are available and how to construct appropriate requests. ### UseHostContext Gets or sets a value indicating whether to use the host application context. #### Syntax ```csharp theme={"dark"} public bool UseHostContext { get; set; } ``` #### Property Value Type: `bool` `true` to use host context for middleware deployments; otherwise, `false`. #### Remarks When enabled in middleware deployments, the MCP server will use the host application's HTTP context to make requests to the OData service. ### ValidateSSL Gets or sets a value indicating whether to validate SSL certificates. #### Syntax ```csharp theme={"dark"} public bool ValidateSSL { get; set; } ``` #### Property Value Type: `bool` `true` to validate SSL certificates; otherwise, `false`. #### Remarks For development environments, SSL validation can be disabled to work with self-signed certificates. This should always be enabled in production. ## Methods ### AddCustomProperty Adds a custom property to the configuration. #### Syntax ```csharp theme={"dark"} public void AddCustomProperty(string key, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The property key. | | `value` | `object` | The property value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### AddDefaultHeader Adds a default header to be included in all OData requests. #### Syntax ```csharp theme={"dark"} public void AddDefaultHeader(string name, string value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The header name. | | `value` | `string` | The header value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* is null or whitespace. | ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetCustomProperty Gets a custom property value. #### Syntax ```csharp theme={"dark"} public T GetCustomProperty(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The property key. | #### Returns Type: `T?` The property value if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the property value. ### GetEntitySetUrl Gets the full URL for an OData entity set. #### Syntax ```csharp theme={"dark"} public string GetEntitySetUrl(string entitySetName, string hostBaseUrl = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySetName` | `string` | The name of the entity set. | | `hostBaseUrl` | `string?` | The host base URL for middleware deployments. | #### Returns Type: `string` The complete URL to the entity set. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *entitySetName* is null or whitespace. | ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadataUrl Gets the full metadata URL for the OData service. #### Syntax ```csharp theme={"dark"} public string GetMetadataUrl(string hostBaseUrl = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `hostBaseUrl` | `string?` | The host base URL for middleware deployments. | #### Returns Type: `string` The complete URL to the metadata endpoint. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration` | The configuration to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveDefaultHeader Removes a default header. #### Syntax ```csharp theme={"dark"} public bool RemoveDefaultHeader(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The header name to remove. | #### Returns Type: `bool` `true` if the header was removed; otherwise, `false`. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the OData service configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate(Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode deploymentMode) ``` #### Parameters | Name | Type | Description | | - | - | - | | `deploymentMode` | `Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode` | The deployment mode for context-specific validation. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # OpenTelemetryConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/OpenTelemetryConfiguration OpenTelemetry configuration for observability. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration ``` ## Summary OpenTelemetry configuration for observability. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public OpenTelemetryConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Enabled Gets or sets a value indicating whether OpenTelemetry is enabled. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` ### OtlpEndpoint Gets or sets the OTLP endpoint for exporting telemetry data. #### Syntax ```csharp theme={"dark"} public string OtlpEndpoint { get; set; } ``` #### Property Value Type: `string?` ### ResourceAttributes Gets or sets additional resource attributes. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary ResourceAttributes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### ServiceName Gets or sets the service name for telemetry data. #### Syntax ```csharp theme={"dark"} public string ServiceName { get; set; } ``` #### Property Value Type: `string` ### ServiceVersion Gets or sets the service version for telemetry data. #### Syntax ```csharp theme={"dark"} public string ServiceVersion { get; set; } ``` #### Property Value Type: `string` ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration` | The configuration to merge. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the OpenTelemetry configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # RateLimitingConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/RateLimitingConfiguration Configuration for request rate limiting and throttling. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration ``` ## Summary Configuration for request rate limiting and throttling. ## Remarks Rate limiting configuration controls how many requests clients can make within specific time windows. This helps protect the server from abuse, denial-of-service attacks, and ensures fair resource usage across clients. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public RateLimitingConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BurstLimit Gets or sets the burst limit for requests. #### Syntax ```csharp theme={"dark"} public int BurstLimit { get; set; } ``` #### Property Value Type: `int` The maximum number of requests allowed in a short burst. #### Remarks The burst limit allows clients to exceed the sustained rate temporarily, accommodating normal traffic spikes while still preventing abuse. ### RequestsPerMinute Gets or sets the maximum number of requests allowed per minute. #### Syntax ```csharp theme={"dark"} public int RequestsPerMinute { get; set; } ``` #### Property Value Type: `int` The maximum requests per minute per client. #### Remarks This sets the sustained rate limit for clients. Requests exceeding this rate will be throttled or rejected based on the rate limiting policy. ### TimeWindow Gets or sets the time window for rate limit calculations. #### Syntax ```csharp theme={"dark"} public System.TimeSpan TimeWindow { get; set; } ``` #### Property Value Type: `System.TimeSpan` The time window over which requests are counted. #### Remarks The time window defines the period over which the rate limit is enforced. Shorter windows provide more responsive protection but may be more sensitive to normal traffic variations. ## Methods ### Clone Creates a copy of this rate limiting configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForProduction Creates a rate limiting configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration ForProduction() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration` A rate limiting configuration suitable for production use. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another rate limiting configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration` | The configuration to merge into this one. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the rate limiting configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # SecurityConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/SecurityConfiguration Configuration for security policies and restrictions. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration ``` ## Summary Configuration for security policies and restrictions. ## Remarks Security configuration includes CORS policies, rate limiting, request size limits, and other security-related settings to protect the MCP server from various threats. ## Constructors ### .ctor Initializes a new instance of the [SecurityConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/SecurityConfiguration) class. #### Syntax ```csharp theme={"dark"} public SecurityConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AllowedHosts Gets or sets the allowed hosts. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List AllowedHosts { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A list of hosts that are allowed to make requests to the server. #### Remarks Host restrictions help prevent host header injection attacks and ensure requests are only accepted from legitimate sources. ### AllowedHttpMethods Gets or sets the allowed HTTP methods. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List AllowedHttpMethods { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A list of HTTP methods that are allowed for requests. #### Remarks Method restrictions limit the attack surface by only allowing necessary HTTP methods for the application's functionality. ### ContentSecurityPolicy Gets or sets the content security policy. #### Syntax ```csharp theme={"dark"} public string ContentSecurityPolicy { get; set; } ``` #### Property Value Type: `string?` The Content Security Policy (CSP) header value. #### Remarks CSP helps prevent XSS attacks by controlling which resources the browser is allowed to load for the page. ### CustomProperties Gets or sets custom security properties. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom security configuration values. #### Remarks Custom properties allow extending the configuration with security settings specific to particular deployment environments or requirements. ### DataProtection Gets or sets the data protection configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration DataProtection { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.DataProtectionConfiguration` Configuration for protecting sensitive data. #### Remarks Data protection configuration specifies how sensitive data should be encrypted, hashed, or otherwise protected both in transit and at rest. ### EnableDetailedErrors Gets or sets a value indicating whether to include detailed error information in responses. #### Syntax ```csharp theme={"dark"} public bool EnableDetailedErrors { get; set; } ``` #### Property Value Type: `bool` `true` to include detailed errors; otherwise, `false`. #### Remarks Detailed error information is useful for debugging but can expose sensitive information to attackers. This should be disabled in production. ### EnableRateLimiting Gets or sets a value indicating whether rate limiting is enabled. #### Syntax ```csharp theme={"dark"} public bool EnableRateLimiting { get; set; } ``` #### Property Value Type: `bool` `true` to enable rate limiting; otherwise, `false`. #### Remarks Rate limiting protects against denial-of-service attacks and abuse by limiting the number of requests from individual clients. ### InputValidation Gets or sets the input validation configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration InputValidation { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration` Configuration for validating user input. #### Remarks Input validation helps prevent injection attacks and ensures data integrity by validating all user-provided data. ### IpRestrictions Gets or sets the IP address restrictions. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration IpRestrictions { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration` Configuration for IP-based access control. #### Remarks IP restrictions provide network-level access control by allowing or denying requests based on client IP addresses. ### MaxQueryParameters Gets or sets the maximum number of query string parameters. #### Syntax ```csharp theme={"dark"} public int MaxQueryParameters { get; set; } ``` #### Property Value Type: `int` The maximum number of parameters allowed in query strings. #### Remarks Parameter count limits prevent parsing-based attacks and ensure predictable request processing performance. ### MaxQueryStringLength Gets or sets the maximum query string length. #### Syntax ```csharp theme={"dark"} public int MaxQueryStringLength { get; set; } ``` #### Property Value Type: `int` The maximum length allowed for query strings. #### Remarks Query string length limits prevent URL-based attacks and ensure compatibility with various web servers and proxies. ### MaxRequestSize Gets or sets the maximum request size in bytes. #### Syntax ```csharp theme={"dark"} public long MaxRequestSize { get; set; } ``` #### Property Value Type: `long` The maximum size allowed for HTTP request bodies. #### Remarks Request size limits prevent memory exhaustion attacks and ensure predictable resource usage. ### RateLimiting Gets or sets the rate limiting configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration RateLimiting { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration` Configuration for request rate limiting. #### Remarks Rate limiting configuration specifies the limits, time windows, and policies for controlling request rates. ### RequireHttps Gets or sets a value indicating whether HTTPS is required. #### Syntax ```csharp theme={"dark"} public bool RequireHttps { get; set; } ``` #### Property Value Type: `bool` `true` to require HTTPS for all requests; otherwise, `false`. #### Remarks HTTPS should be required in production environments to protect data in transit. Development environments may disable this for convenience. ### SecurityHeaders Gets or sets the security headers configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration SecurityHeaders { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration` Configuration for security-related HTTP headers. #### Remarks Security headers provide additional protection against various web-based attacks like XSS, clickjacking, and MIME sniffing. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForDevelopment Creates a configuration optimized for development environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration ForDevelopment() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration` A security configuration suitable for development. ### ForProduction Creates a configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration ForProduction() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration` A security configuration suitable for production. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### IsHostAllowed Determines whether the specified host is allowed. #### Syntax ```csharp theme={"dark"} public bool IsHostAllowed(string host) ``` #### Parameters | Name | Type | Description | | - | - | - | | `host` | `string` | The host to check. | #### Returns Type: `bool` `true` if the host is allowed; otherwise, `false`. ### IsHttpMethodAllowed Determines whether the specified HTTP method is allowed. #### Syntax ```csharp theme={"dark"} public bool IsHttpMethodAllowed(string method) ``` #### Parameters | Name | Type | Description | | - | - | - | | `method` | `string` | The HTTP method to check. | #### Returns Type: `bool` `true` if the method is allowed; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one, with the other configuration taking precedence. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration` | The configuration to merge into this one. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *other* is null. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the security configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # SecurityHeadersConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/SecurityHeadersConfiguration Configuration for security-related HTTP headers. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration ``` ## Summary Configuration for security-related HTTP headers. ## Remarks Security headers configuration controls the HTTP headers that are sent with responses to provide additional protection against various web-based attacks such as XSS, clickjacking, MIME sniffing, and protocol downgrade attacks. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SecurityHeadersConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### EnableHsts Gets or sets a value indicating whether HTTP Strict Transport Security (HSTS) is enabled. #### Syntax ```csharp theme={"dark"} public bool EnableHsts { get; set; } ``` #### Property Value Type: `bool` `true` to enable HSTS; otherwise, `false`. #### Remarks HSTS forces browsers to use HTTPS connections and prevents protocol downgrade attacks. This should be enabled for production environments using HTTPS. ### EnableXContentTypeOptions Gets or sets a value indicating whether X-Content-Type-Options header is enabled. #### Syntax ```csharp theme={"dark"} public bool EnableXContentTypeOptions { get; set; } ``` #### Property Value Type: `bool` `true` to enable X-Content-Type-Options; otherwise, `false`. #### Remarks The X-Content-Type-Options header prevents browsers from MIME sniffing, which can lead to security vulnerabilities when serving user-uploaded content. ### EnableXFrameOptions Gets or sets a value indicating whether X-Frame-Options header is enabled. #### Syntax ```csharp theme={"dark"} public bool EnableXFrameOptions { get; set; } ``` #### Property Value Type: `bool` `true` to enable X-Frame-Options; otherwise, `false`. #### Remarks The X-Frame-Options header prevents the page from being embedded in frames, protecting against clickjacking attacks. ### XFrameOptions Gets or sets the X-Frame-Options header value. #### Syntax ```csharp theme={"dark"} public string XFrameOptions { get; set; } ``` #### Property Value Type: `string` The X-Frame-Options directive value. #### Remarks Valid values are "DENY" (never allow framing), "SAMEORIGIN" (allow framing from same origin), or "ALLOW-FROM uri" (allow framing from specific URI). ## Methods ### Clone Creates a copy of this security headers configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ForDevelopment Creates a security headers configuration optimized for development environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration ForDevelopment() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration` A security headers configuration suitable for development use. ### ForProduction Creates a security headers configuration optimized for production environments. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration ForProduction() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration` A security headers configuration suitable for production use. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another security headers configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.SecurityHeadersConfiguration` | The configuration to merge into this one. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the security headers configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the configuration is valid. # SslConfiguration Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/SslConfiguration SSL/TLS certificate configuration. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Configuration **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Configuration.SslConfiguration ``` ## Summary SSL/TLS certificate configuration. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SslConfiguration() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CertificatePassword Gets or sets the password for the SSL certificate. #### Syntax ```csharp theme={"dark"} public string CertificatePassword { get; set; } ``` #### Property Value Type: `string?` The password to decrypt the certificate file. ### CertificatePath Gets or sets the path to the SSL certificate file. #### Syntax ```csharp theme={"dark"} public string CertificatePath { get; set; } ``` #### Property Value Type: `string?` The file path to the SSL certificate (.pfx, .p12, or .crt file). ### StoreLocation Gets or sets the certificate store location. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.CertificateStoreLocation StoreLocation { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Configuration.CertificateStoreLocation?` The certificate store location for loading certificates. ### StoreName Gets or sets the certificate store name. #### Syntax ```csharp theme={"dark"} public string StoreName { get; set; } ``` #### Property Value Type: `string` The certificate store name for loading certificates. ### SubjectName Gets or sets the certificate subject name. #### Syntax ```csharp theme={"dark"} public string SubjectName { get; set; } ``` #### Property Value Type: `string?` The subject name of the certificate to load from the store. ### Thumbprint Gets or sets the certificate thumbprint. #### Syntax ```csharp theme={"dark"} public string Thumbprint { get; set; } ``` #### Property Value Type: `string?` The thumbprint of the certificate to load from the store. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Configuration.SslConfiguration Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Configuration.SslConfiguration` A new instance with the same settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### MergeWith Merges another configuration into this one. #### Syntax ```csharp theme={"dark"} public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.SslConfiguration other) ``` #### Parameters | Name | Type | Description | | - | - | - | | `other` | `Microsoft.OData.Mcp.Core.Configuration.SslConfiguration` | The configuration to merge. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the SSL configuration. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` Validation errors. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/index Summary of the Microsoft.OData.Mcp.Core.Configuration Namespace ## Types ### Classes | Name | Summary | | - | - | | [BasicAuthenticationCredentials](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/BasicAuthenticationCredentials) | Basic authentication credentials. | | [BuildInfo](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/BuildInfo) | Build information for the MCP server. | | [CacheCompressionConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheCompressionConfiguration) | Configuration for cache compression. | | [CacheEvictionPolicy](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheEvictionPolicy) | Defines the cache eviction policies. | | [CacheProviderType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheProviderType) | Defines the cache provider types. | | [CachingConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CachingConfiguration) | Configuration for metadata and tool caching behavior. | | [DataProtectionConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/DataProtectionConfiguration) | Configuration for data protection and encryption settings. | | [DistributedCacheConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/DistributedCacheConfiguration) | Configuration for distributed caching. | | [FeatureFlagsConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/FeatureFlagsConfiguration) | Configuration for enabling/disabling specific features. | | [InputValidationConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/InputValidationConfiguration) | Configuration for input validation and sanitization. | | [IpRestrictionConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/IpRestrictionConfiguration) | Configuration for IP address restrictions and access control. | | [McpServerConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpServerConfiguration) | Unified configuration for MCP servers supporting both sidecar and middleware deployment modes. | | [McpDeploymentMode](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpDeploymentMode) | Defines the deployment modes for MCP servers. | | [McpServerInfo](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpServerInfo) | Basic information about an MCP server instance. | | [MonitoringConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MonitoringConfiguration) | Configuration for logging, metrics, and health monitoring. | | [OpenTelemetryConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/OpenTelemetryConfiguration) | OpenTelemetry configuration for observability. | | [ApplicationInsightsConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ApplicationInsightsConfiguration) | Azure Application Insights configuration. | | [MetricDefinition](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MetricDefinition) | Custom metric definition. | | [LogFilter](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/LogFilter) | Log filter configuration. | | [AlertingConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/AlertingConfiguration) | Alerting configuration. | | [AlertRule](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/AlertRule) | Alert rule definition. | | [MetricType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MetricType) | Defines the metric types. | | [NetworkConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/NetworkConfiguration) | Configuration for network endpoints, ports, and transport protocols. | | [SslConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/SslConfiguration) | SSL/TLS certificate configuration. | | [CertificateStoreLocation](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CertificateStoreLocation) | Certificate store locations. | | [CorsConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CorsConfiguration) | CORS (Cross-Origin Resource Sharing) configuration. | | [CompressionConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CompressionConfiguration) | HTTP response compression configuration. | | [OAuth2Configuration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/OAuth2Configuration) | OAuth2 configuration for client credentials flow. | | [ODataAuthenticationConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataAuthenticationConfiguration) | Authentication configuration for connecting to OData services. | | [ODataAuthenticationType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataAuthenticationType) | Defines the authentication types for OData services. | | [ODataServiceConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataServiceConfiguration) | Configuration for connecting to and interacting with OData services. | | [RateLimitingConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/RateLimitingConfiguration) | Configuration for request rate limiting and throttling. | | [SecurityConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/SecurityConfiguration) | Configuration for security policies and restrictions. | | [SecurityHeadersConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/SecurityHeadersConfiguration) | Configuration for security-related HTTP headers. | ### Enums | Name | Summary | | - | - | | [CacheEvictionPolicy](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheEvictionPolicy) | Defines the cache eviction policies. | | [CacheProviderType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CacheProviderType) | Defines the cache provider types. | | [McpDeploymentMode](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/McpDeploymentMode) | Defines the deployment modes for MCP servers. | | [MetricType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/MetricType) | Defines the metric types. | | [CertificateStoreLocation](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/CertificateStoreLocation) | Certificate store locations. | | [ODataAuthenticationType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataAuthenticationType) | Defines the authentication types for OData services. | # JsonConstants Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Constants/JsonConstants Provides centralized, reusable JsonSerializerOptions instances to improve memory efficiency and performance. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Constants **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Constants.JsonConstants ``` ## Summary Provides centralized, reusable JsonSerializerOptions instances to improve memory efficiency and performance. ## Remarks Creating new JsonSerializerOptions instances is expensive as each instance creates internal caches and converters. By reusing these static instances, we significantly reduce memory allocations and improve performance. These options are thread-safe and can be used concurrently across the application. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Constants/index Summary of the Microsoft.OData.Mcp.Core.Constants Namespace ## Types ### Classes | Name | Summary | | - | - | | [JsonConstants](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Constants/JsonConstants) | Provides centralized, reusable JsonSerializerOptions instances to improve memory efficiency and performance. | # CrudToolGenerationOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/CrudToolGenerationOptions Options for controlling CRUD tool generation behavior. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy.Generators **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions ``` ## Summary Options for controlling CRUD tool generation behavior. ## Remarks These options allow fine-grained control over which tools are generated and how they behave, including validation, error handling, and feature enablement. CRUD tool generation can be customized to match specific API patterns, security requirements, and performance considerations. ## Constructors ### .ctor Initializes a new instance of the [CrudToolGenerationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/CrudToolGenerationOptions) class. #### Syntax ```csharp theme={"dark"} public CrudToolGenerationOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CustomProperties Gets or sets custom properties that can be used by specific generators. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom properties for generator-specific configuration. #### Remarks Custom properties allow extending the configuration with generator-specific settings that don't fit into the standard options. Different generators may use these properties for specialized behavior. ### ExcludedEntityTypes Gets or sets the list of entity types to exclude from tool generation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet ExcludedEntityTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of entity type names to exclude. #### Remarks Use this to exclude specific entity types from CRUD tool generation, such as system entities, audit tables, or entities that should only be accessed through specialized tools. ### ExcludedProperties Gets or sets the list of properties to exclude from tool generation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> ExcludedProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A dictionary mapping entity type names to lists of excluded properties. #### Remarks Use this to exclude specific properties from tool generation, such as system fields, computed properties, or sensitive information that should not be exposed through MCP tools. ### GenerateCreateTools Gets or sets a value indicating whether to generate CREATE tools. #### Syntax ```csharp theme={"dark"} public bool GenerateCreateTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate CREATE tools; otherwise, `false`. #### Remarks CREATE tools allow AI models to insert new entities into the OData service. Disable this if the service is read-only or create operations should not be exposed through the MCP interface. ### GenerateDeleteTools Gets or sets a value indicating whether to generate DELETE tools. #### Syntax ```csharp theme={"dark"} public bool GenerateDeleteTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate DELETE tools; otherwise, `false`. #### Remarks DELETE tools allow AI models to remove entities from the OData service. This is often disabled in production scenarios due to the irreversible nature of delete operations. ### GenerateDetailedDescriptions Gets or sets a value indicating whether to generate detailed descriptions for tools. #### Syntax ```csharp theme={"dark"} public bool GenerateDetailedDescriptions { get; set; } ``` #### Property Value Type: `bool` `true` to generate detailed descriptions; otherwise, `false`. #### Remarks Detailed descriptions help AI models understand what each tool does and how to use it effectively. This improves the quality of AI interactions but increases the size of tool definitions. ### GenerateReadTools Gets or sets a value indicating whether to generate READ tools. #### Syntax ```csharp theme={"dark"} public bool GenerateReadTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate READ tools; otherwise, `false`. #### Remarks READ tools allow AI models to retrieve entities from the OData service. This is typically enabled unless the service contains sensitive data that should not be accessible through MCP. ### GenerateUpdateTools Gets or sets a value indicating whether to generate UPDATE tools. #### Syntax ```csharp theme={"dark"} public bool GenerateUpdateTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate UPDATE tools; otherwise, `false`. #### Remarks UPDATE tools allow AI models to modify existing entities in the OData service. Disable this for services where data modification should be restricted or controlled through other mechanisms. ### IncludeComplexTypes Gets or sets a value indicating whether to include complex type properties in tools. #### Syntax ```csharp theme={"dark"} public bool IncludeComplexTypes { get; set; } ``` #### Property Value Type: `bool` `true` to include complex types; otherwise, `false`. #### Remarks Complex types represent structured data within entities. Including them in tools allows for complete entity manipulation but may increase tool complexity. Consider the trade-off between functionality and usability. ### IncludeExamples Gets or sets a value indicating whether to include examples in tool descriptions. #### Syntax ```csharp theme={"dark"} public bool IncludeExamples { get; set; } ``` #### Property Value Type: `bool` `true` to include examples; otherwise, `false`. #### Remarks Examples demonstrate how to use tools effectively and can significantly improve AI model performance. However, they increase tool definition size and may expose sensitive data patterns. ### IncludeNavigationProperties Gets or sets a value indicating whether to include navigation properties in tools. #### Syntax ```csharp theme={"dark"} public bool IncludeNavigationProperties { get; set; } ``` #### Property Value Type: `bool` `true` to include navigation properties; otherwise, `false`. #### Remarks Navigation properties represent relationships between entities. Including them can create very complex tools. It's often better to handle relationships through separate navigation tools rather than CRUD tools. ### IncludeValidation Gets or sets a value indicating whether to include validation in generated tools. #### Syntax ```csharp theme={"dark"} public bool IncludeValidation { get; set; } ``` #### Property Value Type: `bool` `true` to include validation; otherwise, `false`. #### Remarks Validation helps ensure that AI models provide valid input parameters and can provide helpful error messages when validation fails. This improves reliability but may impact performance. ### MaxPropertiesPerTool Gets or sets the maximum number of properties to include in a single tool. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxPropertiesPerTool { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum property count, or null for no limit. #### Remarks Large entity types can result in tools with too many parameters, making them difficult for AI models to use effectively. This setting helps limit complexity by splitting large entities into multiple tools or omitting less important properties. ### NamingConvention Gets or sets the naming convention to use for generated tool names. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Legacy.Generators.ToolNamingConvention NamingConvention { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Legacy.Generators.ToolNamingConvention` The naming convention for tool names. #### Remarks Consistent naming conventions help AI models understand and predict tool names. Choose a convention that matches your organization's standards and is familiar to the AI models you're working with. ### UseSchemaDescriptions Gets or sets a value indicating whether to use schema descriptions for tool documentation. #### Syntax ```csharp theme={"dark"} public bool UseSchemaDescriptions { get; set; } ``` #### Property Value Type: `bool` `true` to use schema descriptions; otherwise, `false`. #### Remarks OData schemas may include descriptions and annotations that can be used to generate better tool documentation. Enable this to leverage existing schema documentation in your tool descriptions. ## Methods ### Clone Creates a copy of this configuration. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` A new instance with the same settings. ### Development Creates options optimized for development and testing scenarios. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions Development() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` CRUD tool generation options with all features enabled for development. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExcludeEntityType Adds an entity type to the exclusion list. #### Syntax ```csharp theme={"dark"} public void ExcludeEntityType(string entityTypeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The name of the entity type to exclude. | ### ExcludeProperty Adds a property to the exclusion list for a specific entity type. #### Syntax ```csharp theme={"dark"} public void ExcludeProperty(string entityTypeName, string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The name of the entity type. | | `propertyName` | `string` | The name of the property to exclude. | ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HighSecurity Creates options optimized for high-security scenarios. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions HighSecurity() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` CRUD tool generation options with restricted access and enhanced validation. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReadOnly Creates options optimized for read-only scenarios. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions ReadOnly() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` CRUD tool generation options with only read operations enabled. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ShouldIncludeEntityType Determines whether the specified entity type should be included in tool generation. #### Syntax ```csharp theme={"dark"} public bool ShouldIncludeEntityType(string entityTypeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The name of the entity type to check. | #### Returns Type: `bool` `true` if the entity type should be included; otherwise, `false`. ### ShouldIncludeProperty Determines whether the specified property should be included in tool generation. #### Syntax ```csharp theme={"dark"} public bool ShouldIncludeProperty(string entityTypeName, string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The name of the entity type containing the property. | | `propertyName` | `string` | The name of the property to check. | #### Returns Type: `bool` `true` if the property should be included; otherwise, `false`. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # CrudToolGenerator Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/CrudToolGenerator Generates CRUD (Create, Read, Update, Delete) MCP tools from OData entity types. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy.Generators **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerator ``` ## Summary Generates CRUD (Create, Read, Update, Delete) MCP tools from OData entity types. ## Remarks This generator creates MCP tools that allow AI models to perform basic data operations on OData entities. It generates separate tools for each CRUD operation, with proper validation, documentation, and parameter handling. ## Constructors ### .ctor Initializes a new instance of the [CrudToolGenerator](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/CrudToolGenerator) class. #### Syntax ```csharp theme={"dark"} public CrudToolGenerator(Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GenerateAllCrudToolsAsync Generates all CRUD tools for the specified entity set. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateAllCrudToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to generate tools for. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of generated MCP tools for CRUD operations. ### GenerateCreateToolAsync Generates a CREATE tool for the specified entity type. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateCreateToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to create entities in. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A CREATE MCP tool for the entity type. ### GenerateDeleteToolAsync Generates a DELETE tool for the specified entity type. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateDeleteToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set containing entities to delete. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A DELETE MCP tool for the entity type. ### GenerateReadToolAsync Generates a READ tool for the specified entity type. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateReadToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to read entities from. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A READ MCP tool for the entity type. ### GenerateUpdateToolAsync Generates an UPDATE tool for the specified entity type. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateUpdateToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set containing entities to update. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` An UPDATE MCP tool for the entity type. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NavigationToolGenerationOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/NavigationToolGenerationOptions Options for controlling navigation tool generation behavior. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy.Generators **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions ``` ## Summary Options for controlling navigation tool generation behavior. ## Remarks These options allow fine-grained control over which navigation tools are generated and how they behave, including relationship management and traversal capabilities. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public NavigationToolGenerationOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CustomProperties Gets or sets custom properties that can be used by specific generators. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom properties for generator-specific configuration. ### DefaultPageSize Gets or sets the default page size for related entity results. #### Syntax ```csharp theme={"dark"} public int DefaultPageSize { get; set; } ``` #### Property Value Type: `int` The default number of related entities to return. ### ExcludedEntityTypes Gets or sets the list of entity types to exclude from navigation tool generation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet ExcludedEntityTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of entity type names to exclude. ### ExcludedNavigationProperties Gets or sets the list of navigation properties to exclude from tool generation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> ExcludedNavigationProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A dictionary mapping entity type names to lists of excluded navigation properties. ### GenerateAddRelationshipTools Gets or sets a value indicating whether to generate tools for adding relationships. #### Syntax ```csharp theme={"dark"} public bool GenerateAddRelationshipTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate add relationship tools; otherwise, `false`. ### GenerateDetailedDescriptions Gets or sets a value indicating whether to generate detailed descriptions for tools. #### Syntax ```csharp theme={"dark"} public bool GenerateDetailedDescriptions { get; set; } ``` #### Property Value Type: `bool` `true` to generate detailed descriptions; otherwise, `false`. ### GenerateGetRelatedTools Gets or sets a value indicating whether to generate tools for getting related entities. #### Syntax ```csharp theme={"dark"} public bool GenerateGetRelatedTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate get related tools; otherwise, `false`. ### GenerateRemoveRelationshipTools Gets or sets a value indicating whether to generate tools for removing relationships. #### Syntax ```csharp theme={"dark"} public bool GenerateRemoveRelationshipTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate remove relationship tools; otherwise, `false`. ### IncludeCollectionNavigations Gets or sets a value indicating whether to include collection navigation properties. #### Syntax ```csharp theme={"dark"} public bool IncludeCollectionNavigations { get; set; } ``` #### Property Value Type: `bool` `true` to include collection navigations; otherwise, `false`. ### IncludeExamples Gets or sets a value indicating whether to include examples in tool descriptions. #### Syntax ```csharp theme={"dark"} public bool IncludeExamples { get; set; } ``` #### Property Value Type: `bool` `true` to include examples; otherwise, `false`. ### IncludeSingleNavigations Gets or sets a value indicating whether to include single navigation properties. #### Syntax ```csharp theme={"dark"} public bool IncludeSingleNavigations { get; set; } ``` #### Property Value Type: `bool` `true` to include single navigations; otherwise, `false`. ### MaxPageSize Gets or sets the maximum page size for related entity results. #### Syntax ```csharp theme={"dark"} public int MaxPageSize { get; set; } ``` #### Property Value Type: `int` The maximum number of related entities to return. ### NamingConvention Gets or sets the naming convention to use for generated tool names. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Legacy.Generators.ToolNamingConvention NamingConvention { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Legacy.Generators.ToolNamingConvention` The naming convention for tool names. ### SupportFilter Gets or sets a value indicating whether to support filtering on related entities. #### Syntax ```csharp theme={"dark"} public bool SupportFilter { get; set; } ``` #### Property Value Type: `bool` `true` to support filtering; otherwise, `false`. ### SupportOrderBy Gets or sets a value indicating whether to support ordering on related entities. #### Syntax ```csharp theme={"dark"} public bool SupportOrderBy { get; set; } ``` #### Property Value Type: `bool` `true` to support ordering; otherwise, `false`. ### SupportQueryOptions Gets or sets a value indicating whether to support query options on related entities. #### Syntax ```csharp theme={"dark"} public bool SupportQueryOptions { get; set; } ``` #### Property Value Type: `bool` `true` to support query options; otherwise, `false`. ### SupportTop Gets or sets a value indicating whether to support limiting results on related entities. #### Syntax ```csharp theme={"dark"} public bool SupportTop { get; set; } ``` #### Property Value Type: `bool` `true` to support top results; otherwise, `false`. ### UseSchemaDescriptions Gets or sets a value indicating whether to use schema descriptions for tool documentation. #### Syntax ```csharp theme={"dark"} public bool UseSchemaDescriptions { get; set; } ``` #### Property Value Type: `bool` `true` to use schema descriptions; otherwise, `false`. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # NavigationToolGenerator Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/NavigationToolGenerator Generates navigation MCP tools from OData entity relationships. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy.Generators **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerator ``` ## Summary Generates navigation MCP tools from OData entity relationships. ## Remarks This generator creates MCP tools that allow AI models to traverse entity relationships and work with related entities. It supports getting related entities, adding relationships, and removing relationships for both collection and single navigation properties. ## Constructors ### .ctor Initializes a new instance of the [NavigationToolGenerator](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/NavigationToolGenerator) class. #### Syntax ```csharp theme={"dark"} public NavigationToolGenerator(Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GenerateAddRelationshipToolAsync Generates a tool for adding relationships between entities. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateAddRelationshipToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty navigationProperty, Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The source entity set. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The source entity type. | | `navigationProperty` | `Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty` | The navigation property for the relationship. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A navigation MCP tool for adding relationships. ### GenerateAllNavigationToolsAsync Generates all navigation tools for the specified entity set and its relationships. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateAllNavigationToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to generate tools for. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of generated MCP tools for navigation operations. ### GenerateGetRelatedToolAsync Generates a tool for getting related entities via navigation properties. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateGetRelatedToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty navigationProperty, Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The source entity set. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The source entity type. | | `navigationProperty` | `Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty` | The navigation property to traverse. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A navigation MCP tool for getting related entities. ### GenerateRemoveRelationshipToolAsync Generates a tool for removing relationships between entities. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateRemoveRelationshipToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty navigationProperty, Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The source entity set. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The source entity type. | | `navigationProperty` | `Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty` | The navigation property for the relationship. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.NavigationToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A navigation MCP tool for removing relationships. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # QueryToolGenerationOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/QueryToolGenerationOptions Options for controlling query tool generation behavior. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy.Generators **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions ``` ## Summary Options for controlling query tool generation behavior. ## Remarks These options allow fine-grained control over which query features are enabled and how they behave, including OData query options and result formatting. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public QueryToolGenerationOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CustomProperties Gets or sets custom properties that can be used by specific generators. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom properties for generator-specific configuration. ### DefaultPageSize Gets or sets the default page size for query results. #### Syntax ```csharp theme={"dark"} public int DefaultPageSize { get; set; } ``` #### Property Value Type: `int` The default number of entities to return in a single page. ### ExcludedEntityTypes Gets or sets the list of entity types to exclude from tool generation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet ExcludedEntityTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of entity type names to exclude. ### ExcludedProperties Gets or sets the list of properties to exclude from filtering and sorting. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> ExcludedProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A dictionary mapping entity type names to lists of excluded properties. ### GenerateCountTools Gets or sets a value indicating whether to generate count tools. #### Syntax ```csharp theme={"dark"} public bool GenerateCountTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate count tools; otherwise, `false`. ### GenerateDetailedDescriptions Gets or sets a value indicating whether to generate detailed descriptions for tools. #### Syntax ```csharp theme={"dark"} public bool GenerateDetailedDescriptions { get; set; } ``` #### Property Value Type: `bool` `true` to generate detailed descriptions; otherwise, `false`. ### GenerateListTools Gets or sets a value indicating whether to generate list tools. #### Syntax ```csharp theme={"dark"} public bool GenerateListTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate list tools; otherwise, `false`. ### GenerateSearchTools Gets or sets a value indicating whether to generate search tools. #### Syntax ```csharp theme={"dark"} public bool GenerateSearchTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate search tools; otherwise, `false`. ### IncludeExamples Gets or sets a value indicating whether to include examples in tool descriptions. #### Syntax ```csharp theme={"dark"} public bool IncludeExamples { get; set; } ``` #### Property Value Type: `bool` `true` to include examples; otherwise, `false`. ### MaxPageSize Gets or sets the maximum page size allowed for queries. #### Syntax ```csharp theme={"dark"} public int MaxPageSize { get; set; } ``` #### Property Value Type: `int` The maximum number of entities that can be requested in a single page. ### NamingConvention Gets or sets the naming convention to use for generated tool names. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Legacy.Generators.ToolNamingConvention NamingConvention { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Legacy.Generators.ToolNamingConvention` The naming convention for tool names. ### SupportExpand Gets or sets a value indicating whether to support \$expand query option. #### Syntax ```csharp theme={"dark"} public bool SupportExpand { get; set; } ``` #### Property Value Type: `bool` `true` to support expansion; otherwise, `false`. ### SupportFilter Gets or sets a value indicating whether to support \$filter query option. #### Syntax ```csharp theme={"dark"} public bool SupportFilter { get; set; } ``` #### Property Value Type: `bool` `true` to support filtering; otherwise, `false`. ### SupportOrderBy Gets or sets a value indicating whether to support \$orderby query option. #### Syntax ```csharp theme={"dark"} public bool SupportOrderBy { get; set; } ``` #### Property Value Type: `bool` `true` to support ordering; otherwise, `false`. ### SupportSearch Gets or sets a value indicating whether to support \$search query option. #### Syntax ```csharp theme={"dark"} public bool SupportSearch { get; set; } ``` #### Property Value Type: `bool` `true` to support full-text search; otherwise, `false`. ### SupportSelect Gets or sets a value indicating whether to support \$select query option. #### Syntax ```csharp theme={"dark"} public bool SupportSelect { get; set; } ``` #### Property Value Type: `bool` `true` to support projection; otherwise, `false`. ### SupportSkip Gets or sets a value indicating whether to support \$skip query option. #### Syntax ```csharp theme={"dark"} public bool SupportSkip { get; set; } ``` #### Property Value Type: `bool` `true` to support skipping results; otherwise, `false`. ### SupportTop Gets or sets a value indicating whether to support \$top query option. #### Syntax ```csharp theme={"dark"} public bool SupportTop { get; set; } ``` #### Property Value Type: `bool` `true` to support top results; otherwise, `false`. ### UseSchemaDescriptions Gets or sets a value indicating whether to use schema descriptions for tool documentation. #### Syntax ```csharp theme={"dark"} public bool UseSchemaDescriptions { get; set; } ``` #### Property Value Type: `bool` `true` to use schema descriptions; otherwise, `false`. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # QueryToolGenerator Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/QueryToolGenerator Generates query MCP tools from OData entity types. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy.Generators **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerator ``` ## Summary Generates query MCP tools from OData entity types. ## Remarks This generator creates MCP tools that allow AI models to perform advanced querying operations on OData entities, including filtering, sorting, projection, and expansion. It supports all standard OData query options like $filter, $orderby, $select, $expand, $top, $skip, and \$search. ## Constructors ### .ctor Initializes a new instance of the [QueryToolGenerator](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/QueryToolGenerator) class. #### Syntax ```csharp theme={"dark"} public QueryToolGenerator(Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GenerateAllQueryToolsAsync Generates all query tools for the specified entity set. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateAllQueryToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to generate tools for. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of generated MCP tools for query operations. ### GenerateCountToolAsync Generates a count tool for getting entity counts with optional filtering. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateCountToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to count. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A count MCP tool for the entity type. ### GenerateListToolAsync Generates a query tool for listing entities with filtering and sorting. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateListToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to query. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A query MCP tool for the entity type. ### GenerateSearchToolAsync Generates a search tool for full-text search across entity properties. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateSearchToolAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions options, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to search. | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type definition. | | `options` | `Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions` | Options controlling tool generation behavior. | | `cancellationToken` | `System.Threading.CancellationToken` | Cancellation token for the operation. | #### Returns Type: `System.Threading.Tasks.Task` A search MCP tool for the entity type. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ToolNamingConvention Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/ToolNamingConvention Naming conventions for generated tool names. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy.Generators **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.Generators.ToolNamingConvention ``` ## Summary Naming conventions for generated tool names. ## Remarks Different naming conventions provide flexibility in how tool names are formatted to match organizational standards, programming language conventions, or AI model preferences. Consistent naming helps AI models predict and understand tool functionality. ## Values | Name | Value | Description | | - | - | - | | `PascalCase` | 0 | Use PascalCase naming (e.g., CreateCustomer, UpdateOrder). | | `CamelCase` | 1 | Use camelCase naming (e.g., createCustomer, updateOrder). | | `SnakeCase` | 2 | Use snake\_case naming (e.g., create\_customer, update\_order). | | `KebabCase` | 3 | Use kebab-case naming (e.g., create-customer, update-order). | # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/index Summary of the Microsoft.OData.Mcp.Core.Legacy.Generators Namespace ## Types ### Classes | Name | Summary | | - | - | | [CrudToolGenerationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/CrudToolGenerationOptions) | Options for controlling CRUD tool generation behavior. | | [CrudToolGenerator](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/CrudToolGenerator) | Generates CRUD (Create, Read, Update, Delete) MCP tools from OData entity types. | | [NavigationToolGenerationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/NavigationToolGenerationOptions) | Options for controlling navigation tool generation behavior. | | [NavigationToolGenerator](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/NavigationToolGenerator) | Generates navigation MCP tools from OData entity relationships. | | [QueryToolGenerationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/QueryToolGenerationOptions) | Options for controlling query tool generation behavior. | | [QueryToolGenerator](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/QueryToolGenerator) | Generates query MCP tools from OData entity types. | | [ToolNamingConvention](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/ToolNamingConvention) | Naming conventions for generated tool names. | ### Enums | Name | Summary | | - | - | | [ToolNamingConvention](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/Generators/ToolNamingConvention) | Naming conventions for generated tool names. | # McpTool Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/McpTool Represents an MCP (Model Context Protocol) tool that can be executed by AI models. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Legacy **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Legacy.McpTool ``` ## Summary Represents an MCP (Model Context Protocol) tool that can be executed by AI models. ## Remarks MCP tools define the interface between AI models and external systems, providing structured input/output schemas and execution logic for specific operations. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public McpTool() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Categories Gets or sets the categories or tags associated with the tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet Categories { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of category names or tags. #### Remarks Categories help organize tools and make them easier to discover. Common categories might include "data", "utility", "integration", etc. ### Description Gets or sets the human-readable description of what the tool does. #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string` A detailed description of the tool's purpose and functionality. #### Remarks This description helps AI models understand when and how to use the tool. It should clearly explain the tool's purpose, expected inputs, and outcomes. ### EstimatedExecutionTimeMs Gets or sets the estimated execution time for the tool in milliseconds. #### Syntax ```csharp theme={"dark"} public System.Nullable EstimatedExecutionTimeMs { get; set; } ``` #### Property Value Type: `System.Nullable` The estimated execution time, or null if unknown. #### Remarks This hint helps AI models make informed decisions about tool selection based on performance requirements and timeout constraints. ### Examples Gets or sets examples of how to use the tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Examples { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of usage examples for the tool. #### Remarks Examples help AI models understand the proper usage patterns and expected input/output formats for the tool. ### InputSchema Gets or sets the JSON schema that defines the structure of the tool's input parameters. #### Syntax ```csharp theme={"dark"} public object InputSchema { get; set; } ``` #### Property Value Type: `object?` A JSON schema object describing the expected input format. #### Remarks The input schema defines the parameters that must be provided when invoking the tool. It includes type information, validation rules, descriptions, and examples. ### IsEnabled Gets or sets a value indicating whether the tool is currently enabled and available for use. #### Syntax ```csharp theme={"dark"} public bool IsEnabled { get; set; } ``` #### Property Value Type: `bool` `true` if the tool is enabled; otherwise, `false`. #### Remarks Disabled tools are not presented to AI models for execution. This can be useful for temporarily disabling problematic tools or implementing feature flags. ### MaxConcurrentExecutions Gets or sets the maximum number of concurrent executions allowed for this tool. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxConcurrentExecutions { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum concurrency limit, or null for no limit. #### Remarks Concurrency limits help protect backend resources and ensure system stability when multiple AI models are using the same tools simultaneously. ### Metadata Gets or sets additional metadata about the tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom metadata properties. #### Remarks Metadata can include information about the tool's capabilities, limitations, performance characteristics, or other implementation-specific details. ### Name Gets or sets the unique name of the tool. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` The tool name, which must be unique within the MCP server context. #### Remarks Tool names should be descriptive and follow consistent naming conventions. They are used by AI models to identify and invoke specific operations. ### Version Gets or sets the version of the tool. #### Syntax ```csharp theme={"dark"} public string Version { get; set; } ``` #### Property Value Type: `string` The version string for the tool. #### Remarks Tool versions help track changes and compatibility. They can be used to implement versioning strategies for tool evolution. ## Methods ### Clone Creates a deep copy of the MCP tool. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Legacy.McpTool Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Legacy.McpTool` A new [McpTool](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/McpTool) instance with copied values. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the tool. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the tool's name and description. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the tool definition for completeness and correctness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation error messages, or empty if valid. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/index Summary of the Microsoft.OData.Mcp.Core.Legacy Namespace ## Types ### Classes | Name | Summary | | - | - | | [McpTool](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Legacy/McpTool) | Represents an MCP (Model Context Protocol) tool that can be executed by AI models. | # EdmAction Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmAction Represents an action in the Entity Data Model. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmAction ``` ## Summary Represents an action in the Entity Data Model. ## Remarks Actions are operations that may have side effects and are used to modify data or perform operations that cannot be expressed through standard CRUD operations. ## Constructors ### .ctor Initializes a new instance of the [EdmAction](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmAction) class. #### Syntax ```csharp theme={"dark"} public EdmAction() ``` ### .ctor Initializes a new instance of the [EdmAction](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmAction) class with the specified name and namespace. #### Syntax ```csharp theme={"dark"} public EdmAction(string name, string namespaceName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The action name. | | `namespaceName` | `string` | The namespace containing this action. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BindingParameterType Gets or sets the type that this action is bound to. #### Syntax ```csharp theme={"dark"} public string BindingParameterType { get; set; } ``` #### Property Value Type: `string?` The type name that this action is bound to, if applicable. ### FullName Gets the fully qualified name of the action. #### Syntax ```csharp theme={"dark"} public string FullName { get; } ``` #### Property Value Type: `string` The namespace and name separated by a dot. ### IsBound Gets or sets a value indicating whether the action is bound. #### Syntax ```csharp theme={"dark"} public bool IsBound { get; set; } ``` #### Property Value Type: `bool` `true` if the action is bound to a type; otherwise, `false`. #### Remarks Bound actions are called on instances of a specific type. ### Name Gets or sets the name of the action. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` The action name. ### Namespace Gets or sets the namespace of the action. #### Syntax ```csharp theme={"dark"} public string Namespace { get; set; } ``` #### Property Value Type: `string` The namespace containing this action. ### Parameters Gets or sets the parameters of the action. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Parameters { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of parameters that the action accepts. ### ReturnType Gets or sets the return type of the action. #### Syntax ```csharp theme={"dark"} public string ReturnType { get; set; } ``` #### Property Value Type: `string?` The type returned by the action, if any. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmActionImport Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmActionImport Represents an action import in an OData entity container. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmActionImport ``` ## Summary Represents an action import in an OData entity container. ## Remarks Action imports expose actions as addressable resources in the OData service. They allow actions to be called through the service interface, providing custom operations that can have side effects. Actions are typically invoked using POST requests and can modify the state of the service. ## Constructors ### .ctor Initializes a new instance of the [EdmActionImport](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmActionImport) class. #### Syntax ```csharp theme={"dark"} public EdmActionImport() ``` ### .ctor Initializes a new instance of the [EdmActionImport](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmActionImport) class with the specified name and action. #### Syntax ```csharp theme={"dark"} public EdmActionImport(string name, string action) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the action import. | | `action` | `string` | The fully qualified name of the action being imported. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *action* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Action Gets or sets the fully qualified name of the action being imported. #### Syntax ```csharp theme={"dark"} public required string Action { get; set; } ``` #### Property Value Type: `string` The namespace and name of the action that this import exposes. #### Remarks This references an action defined elsewhere in the model. The action import makes the action accessible as part of the entity container's interface. ### Annotations Gets or sets the annotations for this action import. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Annotations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of annotations that provide additional metadata about the action import. #### Remarks Annotations can be used to specify additional behaviors, constraints, or metadata that are not captured by the standard OData model elements. ### EntitySet Gets or sets the entity set associated with this action import. #### Syntax ```csharp theme={"dark"} public string EntitySet { get; set; } ``` #### Property Value Type: `string?` The name of the entity set, or `null` if the action doesn't return entities from a specific set. #### Remarks When the action returns entities, this property specifies which entity set those entities belong to. This is important for establishing the correct context for navigation properties and other operations. ### Name Gets or sets the name of the action import. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The name used to address this action import in OData URLs. #### Remarks The action import name appears in the URL path when invoking the action. ## Methods ### AddAnnotation Adds an annotation to this action import. #### Syntax ```csharp theme={"dark"} public void AddAnnotation(string term, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | | `value` | `object` | The annotation value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *term* is null or whitespace. | ### Equals Determines whether the specified object is equal to the current action import. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current action import. | #### Returns Type: `bool` `true` if the specified object is equal to the current action import; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAnnotation Gets an annotation value by term. #### Syntax ```csharp theme={"dark"} public T GetAnnotation(string term) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | #### Returns Type: `T?` The annotation value, or the default value of *T* if not found. #### Type Parameters * `T` - The type of the annotation value. ### GetHashCode Returns a hash code for the current action import. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current action import. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the action import. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the action import name and action. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmComplexType Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmComplexType Represents a complex type in an OData model. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmComplexType ``` ## Summary Represents a complex type in an OData model. ## Remarks Complex types are structured types that consist of a set of properties but do not have a key. They are used to define reusable data structures that can be used as property types in entity types or other complex types. Complex types cannot exist independently; they must be contained within an entity or another complex type. ## Constructors ### .ctor Initializes a new instance of the [EdmComplexType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmComplexType) class. #### Syntax ```csharp theme={"dark"} public EdmComplexType() ``` ### .ctor Initializes a new instance of the [EdmComplexType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmComplexType) class with the specified name and namespace. #### Syntax ```csharp theme={"dark"} public EdmComplexType(string name, string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the complex type. | | `namespace` | `string` | The namespace of the complex type. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *namespace* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Abstract Gets or sets a value indicating whether this complex type is abstract. #### Syntax ```csharp theme={"dark"} public bool Abstract { get; set; } ``` #### Property Value Type: `bool` `true` if the complex type is abstract; otherwise, `false`. #### Remarks Abstract complex types cannot be instantiated directly but can serve as base types for other complex types. They are useful for defining common properties and behaviors. ### BaseType Gets or sets the base type of the complex type. #### Syntax ```csharp theme={"dark"} public string BaseType { get; set; } ``` #### Property Value Type: `string?` The fully qualified name of the base complex type, or `null` if this type has no base type. #### Remarks When specified, this complex type inherits all properties from the base type. The inheritance hierarchy must be consistent within the model. ### FullName Gets the fully qualified name of the complex type. #### Syntax ```csharp theme={"dark"} public string FullName { get; } ``` #### Property Value Type: `string` The namespace and name combined with a dot separator. ### HasBaseType Gets a value indicating whether this complex type inherits from another complex type. #### Syntax ```csharp theme={"dark"} public bool HasBaseType { get; } ``` #### Property Value Type: `bool` `true` if the complex type has a base type; otherwise, `false`. ### HasNavigationProperties Gets a value indicating whether this complex type has any navigation properties. #### Syntax ```csharp theme={"dark"} public bool HasNavigationProperties { get; } ``` #### Property Value Type: `bool` `true` if the complex type has navigation properties; otherwise, `false`. ### IsAbstract Gets a value indicating whether this complex type is abstract. #### Syntax ```csharp theme={"dark"} public bool IsAbstract { get; } ``` #### Property Value Type: `bool` `true` if the complex type is abstract; otherwise, `false`. #### Remarks This is an alias for the [EdmComplexType.Abstract](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmComplexType#abstract) property for compatibility. ### Name Gets or sets the name of the complex type. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The local name of the complex type within its namespace. ### Namespace Gets or sets the namespace of the complex type. #### Syntax ```csharp theme={"dark"} public required string Namespace { get; set; } ``` #### Property Value Type: `string` The namespace that contains this complex type. ### NavigationProperties Gets or sets the navigation properties of the complex type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List NavigationProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of navigation properties that define relationships to entities. #### Remarks Navigation properties in complex types enable navigation from the complex type to related entities, but the complex type itself cannot be the target of navigation. ### OpenType Gets or sets a value indicating whether this complex type is open. #### Syntax ```csharp theme={"dark"} public bool OpenType { get; set; } ``` #### Property Value Type: `bool` `true` if the complex type is open; otherwise, `false`. #### Remarks Open complex types allow additional properties beyond those explicitly defined in the metadata. This provides flexibility for dynamic scenarios where the complete structure may not be known at design time. ### Properties Gets or sets the properties of the complex type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Properties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of structural properties that define the data elements of the complex type. #### Remarks These properties represent the data that can be stored and retrieved for instances of this complex type. Unlike entity types, complex types do not have key properties. ## Methods ### Equals Determines whether the specified object is equal to the current complex type. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current complex type. | #### Returns Type: `bool` `true` if the specified object is equal to the current complex type; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Returns a hash code for the current complex type. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current complex type. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetNavigationProperty Gets a navigation property by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty GetNavigationProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the navigation property to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty?` The navigation property with the specified name, or `null` if not found. ### GetProperty Gets a property by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmProperty GetProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the property to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmProperty?` The property with the specified name, or `null` if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasNavigationProperty Determines whether the complex type has a navigation property with the specified name. #### Syntax ```csharp theme={"dark"} public bool HasNavigationProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the navigation property to check. | #### Returns Type: `bool` `true` if the complex type has the navigation property; otherwise, `false`. ### HasProperty Determines whether the complex type has a property with the specified name. #### Syntax ```csharp theme={"dark"} public bool HasProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the property to check. | #### Returns Type: `bool` `true` if the complex type has the property; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the complex type. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` The fully qualified name of the complex type. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmEntityContainer Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityContainer Represents an entity container in an OData model. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmEntityContainer ``` ## Summary Represents an entity container in an OData model. ## Remarks An entity container defines the scope of addressable resources in an OData service. It contains entity sets, singletons, function imports, and action imports that comprise the service's interface. Each OData service must have exactly one entity container. ## Constructors ### .ctor Initializes a new instance of the [EdmEntityContainer](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityContainer) class. #### Syntax ```csharp theme={"dark"} public EdmEntityContainer() ``` ### .ctor Initializes a new instance of the [EdmEntityContainer](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityContainer) class with the specified name and namespace. #### Syntax ```csharp theme={"dark"} public EdmEntityContainer(string name, string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the entity container. | | `namespace` | `string` | The namespace of the entity container. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *namespace* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ActionImports Gets or sets the action imports in this container. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ActionImports { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of action imports that expose actions as addressable resources. #### Remarks Action imports allow actions to be called as part of the OData service interface. Unlike functions, actions can have side effects and are typically invoked via POST requests. ### Annotations Gets or sets the annotations for this entity container. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Annotations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of annotations that provide additional metadata about the entity container. #### Remarks Annotations can be used to specify additional behaviors, constraints, or metadata that are not captured by the standard OData model elements. ### EntitySets Gets or sets the entity sets in this container. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List EntitySets { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of entity sets that define the collections of entities available in the service. #### Remarks Entity sets are the primary addressable resources in an OData service, allowing clients to query, create, update, and delete entities. ### Extends Gets or sets the base entity container. #### Syntax ```csharp theme={"dark"} public string Extends { get; set; } ``` #### Property Value Type: `string?` The fully qualified name of the base entity container, or `null` if this container has no base. #### Remarks When specified, this entity container extends the base container, inheriting all its entity sets, singletons, and operations. This allows for modular composition of services. ### FullName Gets the fully qualified name of the entity container. #### Syntax ```csharp theme={"dark"} public string FullName { get; } ``` #### Property Value Type: `string` The namespace and name combined with a dot separator. ### FunctionImports Gets or sets the function imports in this container. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List FunctionImports { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of function imports that expose functions as addressable resources. #### Remarks Function imports allow functions to be called as part of the OData service interface. They provide a way to expose custom operations that don't fit the standard CRUD pattern. ### HasActionImports Gets a value indicating whether this entity container has any action imports. #### Syntax ```csharp theme={"dark"} public bool HasActionImports { get; } ``` #### Property Value Type: `bool` `true` if the entity container has action imports; otherwise, `false`. ### HasBaseContainer Gets a value indicating whether this entity container extends another container. #### Syntax ```csharp theme={"dark"} public bool HasBaseContainer { get; } ``` #### Property Value Type: `bool` `true` if the entity container has a base container; otherwise, `false`. ### HasEntitySets Gets a value indicating whether this entity container has any entity sets. #### Syntax ```csharp theme={"dark"} public bool HasEntitySets { get; } ``` #### Property Value Type: `bool` `true` if the entity container has entity sets; otherwise, `false`. ### HasFunctionImports Gets a value indicating whether this entity container has any function imports. #### Syntax ```csharp theme={"dark"} public bool HasFunctionImports { get; } ``` #### Property Value Type: `bool` `true` if the entity container has function imports; otherwise, `false`. ### HasSingletons Gets a value indicating whether this entity container has any singletons. #### Syntax ```csharp theme={"dark"} public bool HasSingletons { get; } ``` #### Property Value Type: `bool` `true` if the entity container has singletons; otherwise, `false`. ### Name Gets or sets the name of the entity container. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The local name of the entity container within its namespace. ### Namespace Gets or sets the namespace of the entity container. #### Syntax ```csharp theme={"dark"} public required string Namespace { get; set; } ``` #### Property Value Type: `string` The namespace that contains this entity container. ### Singletons Gets or sets the singletons in this container. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Singletons { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of singletons that define individual entity resources. #### Remarks Singletons represent entities that exist as single instances rather than collections. They are useful for representing unique resources like service configuration or user profiles. ## Methods ### AddAnnotation Adds an annotation to this entity container. #### Syntax ```csharp theme={"dark"} public void AddAnnotation(string term, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | | `value` | `object` | The annotation value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *term* is null or whitespace. | ### AddEntitySet Adds an entity set to this container. #### Syntax ```csharp theme={"dark"} public void AddEntitySet(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entitySet* is null. | | `InvalidOperationException` | Thrown when an entity set with the same name already exists. | ### AddSingleton Adds a singleton to this container. #### Syntax ```csharp theme={"dark"} public void AddSingleton(Microsoft.OData.Mcp.Core.Models.EdmSingleton singleton) ``` #### Parameters | Name | Type | Description | | - | - | - | | `singleton` | `Microsoft.OData.Mcp.Core.Models.EdmSingleton` | The singleton to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *singleton* is null. | | `InvalidOperationException` | Thrown when a singleton with the same name already exists. | ### Equals Determines whether the specified object is equal to the current entity container. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current entity container. | #### Returns Type: `bool` `true` if the specified object is equal to the current entity container; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetActionImport Gets an action import by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmActionImport GetActionImport(string actionImportName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `actionImportName` | `string` | The name of the action import to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmActionImport?` The action import with the specified name, or `null` if not found. ### GetAnnotation Gets an annotation value by term. #### Syntax ```csharp theme={"dark"} public T GetAnnotation(string term) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | #### Returns Type: `T?` The annotation value, or the default value of *T* if not found. #### Type Parameters * `T` - The type of the annotation value. ### GetEntitySet Gets an entity set by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntitySet GetEntitySet(string entitySetName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySetName` | `string` | The name of the entity set to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmEntitySet?` The entity set with the specified name, or `null` if not found. ### GetFunctionImport Gets a function import by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmFunctionImport GetFunctionImport(string functionImportName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `functionImportName` | `string` | The name of the function import to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmFunctionImport?` The function import with the specified name, or `null` if not found. ### GetHashCode Returns a hash code for the current entity container. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current entity container. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetSingleton Gets a singleton by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmSingleton GetSingleton(string singletonName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `singletonName` | `string` | The name of the singleton to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmSingleton?` The singleton with the specified name, or `null` if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the entity container. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` The fully qualified name of the entity container. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmEntitySet Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntitySet Represents an entity set in an OData entity container. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmEntitySet ``` ## Summary Represents an entity set in an OData entity container. ## Remarks Entity sets define collections of entities that can be accessed through the OData service. They provide the addressable resources that clients can query, create, update, and delete. Each entity set is associated with a specific entity type and may include navigation property bindings to establish relationships with other entity sets. ## Constructors ### .ctor Initializes a new instance of the [EdmEntitySet](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntitySet) class. #### Syntax ```csharp theme={"dark"} public EdmEntitySet() ``` ### .ctor Initializes a new instance of the [EdmEntitySet](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntitySet) class with the specified name and entity type. #### Syntax ```csharp theme={"dark"} public EdmEntitySet(string name, string entityType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the entity set. | | `entityType` | `string` | The entity type of the entities in this set. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *entityType* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Annotations Gets or sets the annotations for this entity set. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Annotations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of annotations that provide additional metadata about the entity set. #### Remarks Annotations can be used to specify additional behaviors, constraints, or metadata that are not captured by the standard OData model elements. ### EntityType Gets or sets the entity type of the entities in this set. #### Syntax ```csharp theme={"dark"} public required string EntityType { get; set; } ``` #### Property Value Type: `string` The fully qualified name of the entity type for entities in this set. #### Remarks All entities in the set must be instances of this entity type or its derived types. This determines the structure and properties available for entities in the set. ### EntityTypeName Gets the short name of the entity type (without namespace). #### Syntax ```csharp theme={"dark"} public string EntityTypeName { get; } ``` #### Property Value Type: `string` The entity type name without the namespace prefix. ### EntityTypeNamespace Gets the namespace of the entity type. #### Syntax ```csharp theme={"dark"} public string EntityTypeNamespace { get; } ``` #### Property Value Type: `string` The namespace portion of the entity type, or an empty string if no namespace. ### HasNavigationPropertyBindings Gets a value indicating whether this entity set has any navigation property bindings. #### Syntax ```csharp theme={"dark"} public bool HasNavigationPropertyBindings { get; } ``` #### Property Value Type: `bool` `true` if the entity set has navigation property bindings; otherwise, `false`. ### IncludeInServiceDocument Gets or sets a value indicating whether change tracking is enabled for this entity set. #### Syntax ```csharp theme={"dark"} public bool IncludeInServiceDocument { get; set; } ``` #### Property Value Type: `bool` `true` if change tracking is enabled; otherwise, `false`. #### Remarks When change tracking is enabled, the service can provide delta tokens and support for change tracking queries, allowing clients to efficiently retrieve only changed data. ### Name Gets or sets the name of the entity set. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The name used to address this entity set in OData URLs. #### Remarks The entity set name appears in the URL path when accessing the collection or individual entities within the set. ### NavigationPropertyBindings Gets or sets the navigation property bindings for this entity set. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List NavigationPropertyBindings { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of navigation property bindings that establish relationships with other entity sets. #### Remarks Navigation property bindings specify which entity set should be used when following a navigation property from entities in this set. They establish the connections between related entity sets in the model. ## Methods ### AddAnnotation Adds an annotation to this entity set. #### Syntax ```csharp theme={"dark"} public void AddAnnotation(string term, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | | `value` | `object` | The annotation value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *term* is null or whitespace. | ### AddNavigationPropertyBinding Adds a navigation property binding to this entity set. #### Syntax ```csharp theme={"dark"} public void AddNavigationPropertyBinding(string navigationPropertyPath, string target) ``` #### Parameters | Name | Type | Description | | - | - | - | | `navigationPropertyPath` | `string` | The path of the navigation property. | | `target` | `string` | The target entity set name. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *navigationPropertyPath* or *target* is null or whitespace. | ### Equals Determines whether the specified object is equal to the current entity set. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current entity set. | #### Returns Type: `bool` `true` if the specified object is equal to the current entity set; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAnnotation Gets an annotation value by term. #### Syntax ```csharp theme={"dark"} public T GetAnnotation(string term) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | #### Returns Type: `T?` The annotation value, or the default value of *T* if not found. #### Type Parameters * `T` - The type of the annotation value. ### GetHashCode Returns a hash code for the current entity set. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current entity set. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetNavigationPropertyBinding Gets a navigation property binding by navigation property path. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding GetNavigationPropertyBinding(string navigationPropertyPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `navigationPropertyPath` | `string` | The path of the navigation property. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding?` The navigation property binding with the specified path, or `null` if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveNavigationPropertyBinding Removes a navigation property binding from this entity set. #### Syntax ```csharp theme={"dark"} public bool RemoveNavigationPropertyBinding(string navigationPropertyPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `navigationPropertyPath` | `string` | The path of the navigation property to remove. | #### Returns Type: `bool` `true` if the binding was removed; otherwise, `false`. ### ToString Returns a string representation of the entity set. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the entity set name and entity type. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmEntityType Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityType Represents an entity type in an OData model. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmEntityType ``` ## Summary Represents an entity type in an OData model. ## Remarks Entity types define the structure of entities in an OData service, including their properties, navigation properties, and key definitions. They form the foundation of the entity data model and determine how data is structured and accessed. ## Constructors ### .ctor Initializes a new instance of the [EdmEntityType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityType) class. #### Syntax ```csharp theme={"dark"} public EdmEntityType() ``` ### .ctor Initializes a new instance of the [EdmEntityType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityType) class with the specified name and namespace. #### Syntax ```csharp theme={"dark"} public EdmEntityType(string name, string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the entity type. | | `namespace` | `string` | The namespace of the entity type. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *namespace* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Abstract Gets or sets a value indicating whether this entity type is abstract. #### Syntax ```csharp theme={"dark"} public bool Abstract { get; set; } ``` #### Property Value Type: `bool` `true` if the entity type is abstract; otherwise, `false`. #### Remarks Abstract entity types cannot be instantiated directly but can serve as base types for other entity types. They are useful for defining common properties and behaviors. ### BaseType Gets or sets the base type of the entity type. #### Syntax ```csharp theme={"dark"} public string BaseType { get; set; } ``` #### Property Value Type: `string?` The fully qualified name of the base entity type, or `null` if this type has no base type. #### Remarks When specified, this entity type inherits all properties and navigation properties from the base type. The inheritance hierarchy must be consistent within the model. ### FullName Gets the fully qualified name of the entity type. #### Syntax ```csharp theme={"dark"} public string FullName { get; } ``` #### Property Value Type: `string` The namespace and name combined with a dot separator. ### HasBaseType Gets a value indicating whether this entity type inherits from another entity type. #### Syntax ```csharp theme={"dark"} public bool HasBaseType { get; } ``` #### Property Value Type: `bool` `true` if the entity type has a base type; otherwise, `false`. ### HasNavigationProperties Gets a value indicating whether this entity type has any navigation properties. #### Syntax ```csharp theme={"dark"} public bool HasNavigationProperties { get; } ``` #### Property Value Type: `bool` `true` if the entity type has navigation properties; otherwise, `false`. ### HasStream Gets or sets a value indicating whether this entity type has a stream. #### Syntax ```csharp theme={"dark"} public bool HasStream { get; set; } ``` #### Property Value Type: `bool` `true` if the entity type has a stream; otherwise, `false`. #### Remarks When true, instances of this entity type can have an associated media resource (such as a photo or document) that can be accessed via streaming operations. ### IsAbstract Gets a value indicating whether this entity type is abstract. #### Syntax ```csharp theme={"dark"} public bool IsAbstract { get; } ``` #### Property Value Type: `bool` `true` if the entity type is abstract; otherwise, `false`. #### Remarks This is an alias for the [EdmEntityType.Abstract](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityType#abstract) property for compatibility. ### Key Gets or sets the key properties of the entity type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Key { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of property names that form the entity key. #### Remarks Key properties uniquely identify instances of the entity type. They are used for addressing individual entities and establishing relationships. ### KeyProperties Gets the key properties as [EdmProperty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmProperty) objects. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable KeyProperties { get; } ``` #### Property Value Type: `System.Collections.Generic.IEnumerable` A collection of properties that form the entity key. ### Name Gets or sets the name of the entity type. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The local name of the entity type within its namespace. ### Namespace Gets or sets the namespace of the entity type. #### Syntax ```csharp theme={"dark"} public required string Namespace { get; set; } ``` #### Property Value Type: `string` The namespace that contains this entity type. ### NavigationProperties Gets or sets the navigation properties of the entity type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List NavigationProperties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of navigation properties that define relationships to other entities. #### Remarks Navigation properties enable traversal between related entities and define the relationship structure of the data model. ### NonKeyProperties Gets the non-key properties of the entity type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable NonKeyProperties { get; } ``` #### Property Value Type: `System.Collections.Generic.IEnumerable` A collection of properties that are not part of the entity key. ### OpenType Gets or sets a value indicating whether this entity type is open. #### Syntax ```csharp theme={"dark"} public bool OpenType { get; set; } ``` #### Property Value Type: `bool` `true` if the entity type is open; otherwise, `false`. #### Remarks Open entity types allow additional properties beyond those explicitly defined in the metadata. This provides flexibility for dynamic scenarios where the complete structure may not be known at design time. ### Properties Gets or sets the properties of the entity type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Properties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of structural properties that define the data elements of the entity. #### Remarks These properties represent the data that can be stored and retrieved for instances of this entity type. They include both key and non-key properties. ## Methods ### Equals Determines whether the specified object is equal to the current entity type. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current entity type. | #### Returns Type: `bool` `true` if the specified object is equal to the current entity type; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Returns a hash code for the current entity type. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current entity type. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetNavigationProperty Gets a navigation property by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty GetNavigationProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the navigation property to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty?` The navigation property with the specified name, or `null` if not found. ### GetProperty Gets a property by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmProperty GetProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the property to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmProperty?` The property with the specified name, or `null` if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasNavigationProperty Determines whether the entity type has a navigation property with the specified name. #### Syntax ```csharp theme={"dark"} public bool HasNavigationProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the navigation property to check. | #### Returns Type: `bool` `true` if the entity type has the navigation property; otherwise, `false`. ### HasProperty Determines whether the entity type has a property with the specified name. #### Syntax ```csharp theme={"dark"} public bool HasProperty(string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `propertyName` | `string` | The name of the property to check. | #### Returns Type: `bool` `true` if the entity type has the property; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the entity type. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` The fully qualified name of the entity type. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmFunction Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunction Represents a function in the Entity Data Model. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmFunction ``` ## Summary Represents a function in the Entity Data Model. ## Remarks Functions are operations that can be called to retrieve data or perform calculations. They are side-effect free and can be composed with other query operations. ## Constructors ### .ctor Initializes a new instance of the [EdmFunction](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunction) class. #### Syntax ```csharp theme={"dark"} public EdmFunction() ``` ### .ctor Initializes a new instance of the [EdmFunction](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunction) class with the specified name and namespace. #### Syntax ```csharp theme={"dark"} public EdmFunction(string name, string namespaceName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The function name. | | `namespaceName` | `string` | The namespace containing this function. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### BindingParameterType Gets or sets the type that this function is bound to. #### Syntax ```csharp theme={"dark"} public string BindingParameterType { get; set; } ``` #### Property Value Type: `string?` The type name that this function is bound to, if applicable. ### FullName Gets the fully qualified name of the function. #### Syntax ```csharp theme={"dark"} public string FullName { get; } ``` #### Property Value Type: `string` The namespace and name separated by a dot. ### IsBound Gets or sets a value indicating whether the function is bound. #### Syntax ```csharp theme={"dark"} public bool IsBound { get; set; } ``` #### Property Value Type: `bool` `true` if the function is bound to a type; otherwise, `false`. #### Remarks Bound functions are called on instances of a specific type. ### IsComposable Gets or sets a value indicating whether the function is composable. #### Syntax ```csharp theme={"dark"} public bool IsComposable { get; set; } ``` #### Property Value Type: `bool` `true` if the function is composable; otherwise, `false`. #### Remarks Composable functions can be used in query expressions and can be combined with other operations. ### Name Gets or sets the name of the function. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` The function name. ### Namespace Gets or sets the namespace of the function. #### Syntax ```csharp theme={"dark"} public string Namespace { get; set; } ``` #### Property Value Type: `string` The namespace containing this function. ### Parameters Gets or sets the parameters of the function. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Parameters { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of parameters that the function accepts. ### ReturnType Gets or sets the return type of the function. #### Syntax ```csharp theme={"dark"} public string ReturnType { get; set; } ``` #### Property Value Type: `string?` The type returned by the function. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmFunctionImport Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunctionImport Represents a function import in an OData entity container. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmFunctionImport ``` ## Summary Represents a function import in an OData entity container. ## Remarks Function imports expose functions as addressable resources in the OData service. They allow functions to be called through the service interface, providing custom operations that don't fit the standard CRUD pattern. Functions are side-effect free and can be invoked using GET requests. ## Constructors ### .ctor Initializes a new instance of the [EdmFunctionImport](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunctionImport) class. #### Syntax ```csharp theme={"dark"} public EdmFunctionImport() ``` ### .ctor Initializes a new instance of the [EdmFunctionImport](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunctionImport) class with the specified name and function. #### Syntax ```csharp theme={"dark"} public EdmFunctionImport(string name, string function) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the function import. | | `function` | `string` | The fully qualified name of the function being imported. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *function* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Annotations Gets or sets the annotations for this function import. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Annotations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of annotations that provide additional metadata about the function import. #### Remarks Annotations can be used to specify additional behaviors, constraints, or metadata that are not captured by the standard OData model elements. ### EntitySet Gets or sets the entity set associated with this function import. #### Syntax ```csharp theme={"dark"} public string EntitySet { get; set; } ``` #### Property Value Type: `string?` The name of the entity set, or `null` if the function doesn't return entities from a specific set. #### Remarks When the function returns entities, this property specifies which entity set those entities belong to. This is important for establishing the correct context for navigation properties and other operations. ### Function Gets or sets the fully qualified name of the function being imported. #### Syntax ```csharp theme={"dark"} public required string Function { get; set; } ``` #### Property Value Type: `string` The namespace and name of the function that this import exposes. #### Remarks This references a function defined elsewhere in the model. The function import makes the function accessible as part of the entity container's interface. ### IncludeInServiceDocument Gets or sets a value indicating whether this function import is included in the service document. #### Syntax ```csharp theme={"dark"} public bool IncludeInServiceDocument { get; set; } ``` #### Property Value Type: `bool` `true` if the function import should be included in the service document; otherwise, `false`. #### Remarks When true, the function import will be listed in the service document, making it discoverable by clients. When false, clients must know the function import name in advance to use it. ### Name Gets or sets the name of the function import. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The name used to address this function import in OData URLs. #### Remarks The function import name appears in the URL path when invoking the function. ## Methods ### AddAnnotation Adds an annotation to this function import. #### Syntax ```csharp theme={"dark"} public void AddAnnotation(string term, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | | `value` | `object` | The annotation value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *term* is null or whitespace. | ### Equals Determines whether the specified object is equal to the current function import. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current function import. | #### Returns Type: `bool` `true` if the specified object is equal to the current function import; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAnnotation Gets an annotation value by term. #### Syntax ```csharp theme={"dark"} public T GetAnnotation(string term) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | #### Returns Type: `T?` The annotation value, or the default value of *T* if not found. #### Type Parameters * `T` - The type of the annotation value. ### GetHashCode Returns a hash code for the current function import. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current function import. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the function import. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the function import name and function. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmModel Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmModel Represents a complete OData Entity Data Model (EDM). ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmModel ``` ## Summary Represents a complete OData Entity Data Model (EDM). ## Remarks The EDM defines the structure of data exposed by an OData service, including entity types, complex types, entity containers, and their relationships. This class serves as the root model that contains all metadata necessary to understand and interact with an OData service. ## Constructors ### .ctor Initializes a new instance of the [EdmModel](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmModel) class. #### Syntax ```csharp theme={"dark"} public EdmModel() ``` ### .ctor Initializes a new instance of the [EdmModel](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmModel) class with the specified version. #### Syntax ```csharp theme={"dark"} public EdmModel(string version) ``` #### Parameters | Name | Type | Description | | - | - | - | | `version` | `string` | The version of the EDM. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *version* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Actions Gets or sets the actions defined in this model. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Actions { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of actions that can be invoked on the service. #### Remarks Actions are operations that may have side effects and are used to modify data or perform operations that cannot be expressed through standard CRUD operations. ### AllEntitySets Gets all entity sets from all entity containers. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable AllEntitySets { get; } ``` #### Property Value Type: `System.Collections.Generic.IEnumerable` A flattened collection of all entity sets in the model. ### AllSingletons Gets all singletons from all entity containers. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable AllSingletons { get; } ``` #### Property Value Type: `System.Collections.Generic.IEnumerable` A flattened collection of all singletons in the model. ### Annotations Gets or sets the annotations for this model. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Annotations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of annotations that provide additional metadata about the model. #### Remarks Annotations can be used to specify additional behaviors, constraints, or metadata that are not captured by the standard OData model elements. ### ComplexTypes Gets or sets the complex types defined in this model. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ComplexTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of complex types that define reusable structured data elements. #### Remarks Complex types are structured types without keys that can be used as property types in entity types or other complex types. ### EntityContainer Gets the primary entity container for this model (alias for PrimaryContainer). #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntityContainer EntityContainer { get; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Models.EdmEntityContainer?` The first entity container, or `null` if no containers are defined. ### EntityContainers Gets or sets the entity containers defined in this model. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List EntityContainers { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of entity containers that define the service interface. #### Remarks Entity containers define the addressable resources in the OData service. Typically, there is one primary entity container per service. ### EntityTypes Gets or sets the entity types defined in this model. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List EntityTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of entity types that define the structure of entities in the service. #### Remarks Entity types are the primary structural elements in the EDM, defining the properties and relationships that make up the data model. ### Functions Gets or sets the functions defined in this model. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Functions { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of functions that can be called on the service. #### Remarks Functions are operations that can be called to retrieve data or perform calculations. They are side-effect free and can be composed with other query operations. ### HasComplexTypes Gets a value indicating whether this model has any complex types. #### Syntax ```csharp theme={"dark"} public bool HasComplexTypes { get; } ``` #### Property Value Type: `bool` `true` if the model has complex types; otherwise, `false`. ### HasEntityContainers Gets a value indicating whether this model has any entity containers. #### Syntax ```csharp theme={"dark"} public bool HasEntityContainers { get; } ``` #### Property Value Type: `bool` `true` if the model has entity containers; otherwise, `false`. ### HasEntityTypes Gets a value indicating whether this model has any entity types. #### Syntax ```csharp theme={"dark"} public bool HasEntityTypes { get; } ``` #### Property Value Type: `bool` `true` if the model has entity types; otherwise, `false`. ### Namespaces Gets or sets the namespaces used in this model. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Namespaces { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of namespace strings that organize the types in the model. #### Remarks Namespaces provide organizational structure and help avoid naming conflicts between types from different sources. ### PrimaryContainer Gets the primary entity container for this model. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntityContainer PrimaryContainer { get; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Models.EdmEntityContainer?` The first entity container, or `null` if no containers are defined. #### Remarks Most OData services have a single entity container that serves as the primary interface. This property provides convenient access to that container. ### Version Gets or sets the version of the EDM. #### Syntax ```csharp theme={"dark"} public string Version { get; set; } ``` #### Property Value Type: `string` The version string (e.g., "4.0", "4.01"). #### Remarks This indicates which version of the OData standard the model conforms to. Different versions have different capabilities and syntax. ## Methods ### AddAnnotation Adds an annotation to this model. #### Syntax ```csharp theme={"dark"} public void AddAnnotation(string term, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | | `value` | `object` | The annotation value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *term* is null or whitespace. | ### AddComplexType Adds a complex type to the model. #### Syntax ```csharp theme={"dark"} public void AddComplexType(Microsoft.OData.Mcp.Core.Models.EdmComplexType complexType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `complexType` | `Microsoft.OData.Mcp.Core.Models.EdmComplexType` | The complex type to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *complexType* is null. | | `InvalidOperationException` | Thrown when a complex type with the same full name already exists. | ### AddEntityContainer Adds an entity container to the model. #### Syntax ```csharp theme={"dark"} public void AddEntityContainer(Microsoft.OData.Mcp.Core.Models.EdmEntityContainer entityContainer) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityContainer` | `Microsoft.OData.Mcp.Core.Models.EdmEntityContainer` | The entity container to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityContainer* is null. | | `InvalidOperationException` | Thrown when an entity container with the same full name already exists. | ### AddEntityType Adds an entity type to the model. #### Syntax ```csharp theme={"dark"} public void AddEntityType(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityType* is null. | | `InvalidOperationException` | Thrown when an entity type with the same full name already exists. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAnnotation Gets an annotation value by term. #### Syntax ```csharp theme={"dark"} public T GetAnnotation(string term) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | #### Returns Type: `T?` The annotation value, or the default value of *T* if not found. #### Type Parameters * `T` - The type of the annotation value. ### GetComplexType Gets a complex type by its fully qualified name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmComplexType GetComplexType(string fullName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `fullName` | `string` | The fully qualified name of the complex type (namespace.name). | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmComplexType?` The complex type with the specified name, or `null` if not found. ### GetComplexType Gets a complex type by name and namespace. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmComplexType GetComplexType(string name, string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the complex type. | | `namespace` | `string` | The namespace of the complex type. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmComplexType?` The complex type with the specified name and namespace, or `null` if not found. ### GetEntityContainer Gets an entity container by its fully qualified name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntityContainer GetEntityContainer(string fullName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `fullName` | `string` | The fully qualified name of the entity container (namespace.name). | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmEntityContainer?` The entity container with the specified name, or `null` if not found. ### GetEntityContainer Gets an entity container by name and namespace. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntityContainer GetEntityContainer(string name, string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the entity container. | | `namespace` | `string` | The namespace of the entity container. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmEntityContainer?` The entity container with the specified name and namespace, or `null` if not found. ### GetEntitySet Gets an entity set by name from any entity container. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntitySet GetEntitySet(string entitySetName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySetName` | `string` | The name of the entity set. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmEntitySet?` The entity set with the specified name, or `null` if not found. ### GetEntityType Gets an entity type by its fully qualified name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntityType GetEntityType(string fullName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `fullName` | `string` | The fully qualified name of the entity type (namespace.name). | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmEntityType?` The entity type with the specified name, or `null` if not found. ### GetEntityType Gets an entity type by name and namespace. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmEntityType GetEntityType(string name, string namespace) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the entity type. | | `namespace` | `string` | The namespace of the entity type. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmEntityType?` The entity type with the specified name and namespace, or `null` if not found. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetSingleton Gets a singleton by name from any entity container. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmSingleton GetSingleton(string singletonName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `singletonName` | `string` | The name of the singleton. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmSingleton?` The singleton with the specified name, or `null` if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the model. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the model contents. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the model for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or an empty collection if the model is valid. # EdmNavigationProperty Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationProperty Represents a navigation property in an OData entity type. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmNavigationProperty ``` ## Summary Represents a navigation property in an OData entity type. ## Remarks Navigation properties define relationships between entity types, allowing traversal from one entity to related entities. They can represent both single-valued and collection-valued relationships. ## Constructors ### .ctor Initializes a new instance of the [EdmNavigationProperty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationProperty) class. #### Syntax ```csharp theme={"dark"} public EdmNavigationProperty() ``` ### .ctor Initializes a new instance of the [EdmNavigationProperty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationProperty) class with the specified name and type. #### Syntax ```csharp theme={"dark"} public EdmNavigationProperty(string name, string type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the navigation property. | | `type` | `string` | The type of the navigation property. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *type* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ContainsTarget Gets or sets a value indicating whether the navigation property contains dependent entities. #### Syntax ```csharp theme={"dark"} public bool ContainsTarget { get; set; } ``` #### Property Value Type: `bool` `true` if this navigation property contains dependent entities; otherwise, `false`. #### Remarks When true, this indicates that the target entities depend on the source entity for their existence. Deleting the source entity should cascade to delete the dependent entities. ### IsCollection Gets a value indicating whether this navigation property represents a collection. #### Syntax ```csharp theme={"dark"} public bool IsCollection { get; } ``` #### Property Value Type: `bool` `true` if the navigation property is collection-valued; otherwise, `false`. ### IsRequired Gets a value indicating whether the navigation property is required (non-nullable). #### Syntax ```csharp theme={"dark"} public bool IsRequired { get; } ``` #### Property Value Type: `bool` `true` if the navigation property is required; otherwise, `false`. ### Multiplicity Gets the multiplicity of this navigation property. #### Syntax ```csharp theme={"dark"} public string Multiplicity { get; } ``` #### Property Value Type: `string` A string indicating the relationship multiplicity. #### Remarks Returns "Many" for collection-valued properties, "One" for non-nullable single-valued properties, and "ZeroOrOne" for nullable single-valued properties. ### Name Gets or sets the name of the navigation property. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The navigation property name as defined in the CSDL metadata. ### Nullable Gets or sets a value indicating whether the navigation property can contain null values. #### Syntax ```csharp theme={"dark"} public bool Nullable { get; set; } ``` #### Property Value Type: `bool` `true` if the navigation property is nullable; otherwise, `false`. #### Remarks This property is typically relevant for to-one relationships. Collection-valued navigation properties are generally non-nullable (the collection itself, not its elements). ### OnDelete Gets or sets the on-delete action for this navigation property. #### Syntax ```csharp theme={"dark"} public string OnDelete { get; set; } ``` #### Property Value Type: `string?` The action to take when the target entity is deleted, or `null` if not specified. #### Remarks Common values include "Cascade" for cascading deletes and "SetNull" for setting the foreign key to null. The specific behavior depends on the underlying data store. ### Partner Gets or sets the name of the partner navigation property. #### Syntax ```csharp theme={"dark"} public string Partner { get; set; } ``` #### Property Value Type: `string?` The name of the corresponding navigation property on the target entity type, or `null` if not specified. #### Remarks The partner property represents the inverse side of a bidirectional relationship. For example, if Customer has Orders navigation property, Order might have a Customer partner property. ### ReferentialConstraints Gets or sets the referential constraints for this navigation property. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List ReferentialConstraints { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of referential constraints that define the foreign key relationships. #### Remarks Referential constraints specify how the navigation property relates to properties in the source and target entity types, effectively defining foreign key relationships. ### TargetType Gets the target entity type name. #### Syntax ```csharp theme={"dark"} public string TargetType { get; } ``` #### Property Value Type: `string` The fully qualified name of the target entity type. #### Remarks For collection-valued navigation properties, this returns the element type within the Collection(). For single-valued properties, this returns the type directly. ### TargetTypeName Gets the target type name of the navigation property. #### Syntax ```csharp theme={"dark"} public string TargetTypeName { get; } ``` #### Property Value Type: `string` The target entity type name without Collection() wrapper. ### Type Gets or sets the type of the navigation property. #### Syntax ```csharp theme={"dark"} public required string Type { get; set; } ``` #### Property Value Type: `string` The target entity type, optionally wrapped in Collection() for to-many relationships. ## Methods ### Equals Determines whether the specified object is equal to the current navigation property. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current navigation property. | #### Returns Type: `bool` `true` if the specified object is equal to the current navigation property; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Returns a hash code for the current navigation property. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current navigation property. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the navigation property. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the navigation property name and type. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmNavigationPropertyBinding Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationPropertyBinding Represents a navigation property binding in an entity set. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding ``` ## Summary Represents a navigation property binding in an entity set. ## Remarks Navigation property bindings establish the connection between navigation properties and the entity sets that contain the target entities. They are essential for defining how relationships are resolved in the OData service. ## Constructors ### .ctor Initializes a new instance of the [EdmNavigationPropertyBinding](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationPropertyBinding) class. #### Syntax ```csharp theme={"dark"} public EdmNavigationPropertyBinding() ``` ### .ctor Initializes a new instance of the [EdmNavigationPropertyBinding](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationPropertyBinding) class with the specified path and target. #### Syntax ```csharp theme={"dark"} public EdmNavigationPropertyBinding(string path, string target) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `string` | The path of the navigation property. | | `target` | `string` | The target entity set name. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *path* or *target* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Path Gets or sets the path of the navigation property. #### Syntax ```csharp theme={"dark"} public required string Path { get; set; } ``` #### Property Value Type: `string` The navigation property path, which may be a simple property name or a more complex path. #### Remarks The path identifies which navigation property this binding applies to. For simple cases, this is just the property name. For more complex scenarios involving inheritance or containment, the path may include type casts or additional segments. ### Target Gets or sets the target entity set name. #### Syntax ```csharp theme={"dark"} public required string Target { get; set; } ``` #### Property Value Type: `string` The name of the entity set that contains the target entities for this navigation property. #### Remarks When following this navigation property, the target entities will be found in the entity set specified by this property. The target entity set must be defined in the same entity container. ## Methods ### Equals Determines whether the specified object is equal to the current navigation property binding. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current navigation property binding. | #### Returns Type: `bool` `true` if the specified object is equal to the current navigation property binding; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Returns a hash code for the current navigation property binding. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current navigation property binding. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the navigation property binding. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string showing the path and target relationship. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmParameter Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmParameter Represents a parameter in the Entity Data Model. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmParameter ``` ## Summary Represents a parameter in the Entity Data Model. ## Remarks Parameters are used to define inputs to functions and actions in the OData model. ## Constructors ### .ctor Initializes a new instance of the [EdmParameter](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmParameter) class. #### Syntax ```csharp theme={"dark"} public EdmParameter() ``` ### .ctor Initializes a new instance of the [EdmParameter](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmParameter) class with the specified name and type. #### Syntax ```csharp theme={"dark"} public EdmParameter(string name, string type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The parameter name. | | `type` | `string` | The parameter type. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### MaxLength Gets or sets the maximum length for string parameters. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxLength { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum length, or null if not specified. ### Name Gets or sets the name of the parameter. #### Syntax ```csharp theme={"dark"} public string Name { get; set; } ``` #### Property Value Type: `string` The parameter name. ### Nullable Gets or sets a value indicating whether the parameter is nullable. #### Syntax ```csharp theme={"dark"} public bool Nullable { get; set; } ``` #### Property Value Type: `bool` `true` if the parameter accepts null values; otherwise, `false`. ### Precision Gets or sets the precision for numeric parameters. #### Syntax ```csharp theme={"dark"} public System.Nullable Precision { get; set; } ``` #### Property Value Type: `System.Nullable` The precision, or null if not specified. ### Scale Gets or sets the scale for decimal parameters. #### Syntax ```csharp theme={"dark"} public System.Nullable Scale { get; set; } ``` #### Property Value Type: `System.Nullable` The scale, or null if not specified. ### Type Gets or sets the type of the parameter. #### Syntax ```csharp theme={"dark"} public string Type { get; set; } ``` #### Property Value Type: `string` The parameter type. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmPrimitiveType Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmPrimitiveType Represents the EDM primitive types as defined in the OData specification. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmPrimitiveType ``` ## Summary Represents the EDM primitive types as defined in the OData specification. ## Remarks These types correspond to the primitive types defined in the Entity Data Model (EDM) and are used to represent the basic data types in OData services. ## Values | Name | Value | Description | | - | - | - | | `Binary` | 0 | Represents binary data. | | `Boolean` | 1 | Represents a boolean value (true or false). | | `Byte` | 2 | Represents a single byte unsigned integer. | | `Date` | 3 | Represents a date value without time information. | | `DateTimeOffset` | 4 | Represents a date and time value. | | `Decimal` | 5 | Represents a numeric value with fixed precision and scale. | | `Double` | 6 | Represents a 64-bit floating point value. | | `Duration` | 7 | Represents a duration value. | | `Guid` | 8 | Represents a 128-bit globally unique identifier. | | `Int16` | 9 | Represents a 16-bit signed integer. | | `Int32` | 10 | Represents a 32-bit signed integer. | | `Int64` | 11 | Represents a 64-bit signed integer. | | `SByte` | 12 | Represents a signed byte. | | `Single` | 13 | Represents a 32-bit floating point value. | | `Stream` | 14 | Represents a stream value. | | `String` | 15 | Represents a string value. | | `TimeOfDay` | 16 | Represents a time of day value. | | `Geography` | 17 | Represents geography data. | | `GeographyPoint` | 18 | Represents geography point data. | | `GeographyLineString` | 19 | Represents geography line string data. | | `GeographyPolygon` | 20 | Represents geography polygon data. | | `GeographyMultiPoint` | 21 | Represents geography multi-point data. | | `GeographyMultiLineString` | 22 | Represents geography multi-line string data. | | `GeographyMultiPolygon` | 23 | Represents geography multi-polygon data. | | `GeographyCollection` | 24 | Represents geography collection data. | | `Geometry` | 25 | Represents geometry data. | | `GeometryPoint` | 26 | Represents geometry point data. | | `GeometryLineString` | 27 | Represents geometry line string data. | | `GeometryPolygon` | 28 | Represents geometry polygon data. | | `GeometryMultiPoint` | 29 | Represents geometry multi-point data. | | `GeometryMultiLineString` | 30 | Represents geometry multi-line string data. | | `GeometryMultiPolygon` | 31 | Represents geometry multi-polygon data. | | `GeometryCollection` | 32 | Represents geometry collection data. | # EdmProperty Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmProperty Represents a property in an OData entity type or complex type. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmProperty ``` ## Summary Represents a property in an OData entity type or complex type. ## Remarks Properties define the structure and data characteristics of entity types and complex types. They specify the name, type, and various constraints of the data elements. ## Constructors ### .ctor Initializes a new instance of the [EdmProperty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmProperty) class. #### Syntax ```csharp theme={"dark"} public EdmProperty() ``` ### .ctor Initializes a new instance of the [EdmProperty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmProperty) class with the specified name and type. #### Syntax ```csharp theme={"dark"} public EdmProperty(string name, string type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the property. | | `type` | `string` | The type of the property. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *type* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### DefaultValue Gets or sets the default value of the property. #### Syntax ```csharp theme={"dark"} public string DefaultValue { get; set; } ``` #### Property Value Type: `string?` The default value as a string, or `null` if not specified. #### Remarks The default value is represented as it appears in the CSDL metadata. Type-specific parsing is required when using this value. ### Description Gets or sets the description of the property. #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string?` A human-readable description of the property's purpose. ### ElementType Gets the element type for collection properties. #### Syntax ```csharp theme={"dark"} public string ElementType { get; } ``` #### Property Value Type: `string` The element type of the collection, or the type itself if not a collection. ### HasDefaultValue Gets a value indicating whether the property has a default value. #### Syntax ```csharp theme={"dark"} public bool HasDefaultValue { get; } ``` #### Property Value Type: `bool` `true` if the property has a default value; otherwise, `false`. ### IsCollection Gets a value indicating whether this property represents a collection type. #### Syntax ```csharp theme={"dark"} public bool IsCollection { get; } ``` #### Property Value Type: `bool` `true` if the property type is a collection; otherwise, `false`. ### IsKey Gets or sets a value indicating whether this property is part of the entity key. #### Syntax ```csharp theme={"dark"} public bool IsKey { get; set; } ``` #### Property Value Type: `bool` `true` if the property is a key property; otherwise, `false`. #### Remarks Key properties uniquely identify an entity instance and are typically non-nullable. ### IsNullable Gets a value indicating whether the property is nullable (alias for Nullable property). #### Syntax ```csharp theme={"dark"} public bool IsNullable { get; } ``` #### Property Value Type: `bool` `true` if the property is nullable; otherwise, `false`. ### IsPrimitive Gets a value indicating whether this property represents a primitive type. #### Syntax ```csharp theme={"dark"} public bool IsPrimitive { get; } ``` #### Property Value Type: `bool` `true` if the property type is an EDM primitive type; otherwise, `false`. ### MaxLength Gets or sets the maximum length of the property value. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxLength { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum length, or `null` if not specified. #### Remarks This constraint applies primarily to string and binary properties. A value of "Max" in the metadata is represented as `null` here. ### Name Gets or sets the name of the property. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The property name as defined in the CSDL metadata. ### Nullable Gets or sets a value indicating whether the property can contain null values. #### Syntax ```csharp theme={"dark"} public bool Nullable { get; set; } ``` #### Property Value Type: `bool` `true` if the property is nullable; otherwise, `false`. #### Remarks When not specified in the metadata, this property defaults to `true` for most types, except for key properties which are typically non-nullable. ### Precision Gets or sets the precision of the property value. #### Syntax ```csharp theme={"dark"} public System.Nullable Precision { get; set; } ``` #### Property Value Type: `System.Nullable` The precision, or `null` if not specified. #### Remarks Precision applies to decimal and temporal types, indicating the total number of digits. ### Scale Gets or sets the scale of the property value. #### Syntax ```csharp theme={"dark"} public System.Nullable Scale { get; set; } ``` #### Property Value Type: `System.Nullable` The scale, or `null` if not specified. #### Remarks Scale applies to decimal types, indicating the number of digits after the decimal point. A value of "Variable" in the metadata is represented as `null` here. ### SRID Gets or sets the SRID (Spatial Reference System Identifier) for spatial properties. #### Syntax ```csharp theme={"dark"} public string SRID { get; set; } ``` #### Property Value Type: `string?` The SRID value, or `null` if not applicable or not specified. #### Remarks This property is relevant only for geography and geometry types. ### Type Gets or sets the type of the property. #### Syntax ```csharp theme={"dark"} public required string Type { get; set; } ``` #### Property Value Type: `string` The fully qualified type name (e.g., "Edm.String", "Namespace.EntityType"). ### TypeName Gets the type name of the property (alias for Type property). #### Syntax ```csharp theme={"dark"} public string TypeName { get; } ``` #### Property Value Type: `string` The fully qualified type name (e.g., "Edm.String", "Namespace.EntityType"). ### Unicode Gets or sets a value indicating whether the property uses Unicode encoding. #### Syntax ```csharp theme={"dark"} public System.Nullable Unicode { get; set; } ``` #### Property Value Type: `System.Nullable` `true` if Unicode is enabled; `false` if disabled; `null` if not specified. #### Remarks This property applies to string properties and affects how the data is stored and transmitted. ## Methods ### Equals Determines whether the specified object is equal to the current property. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current property. | #### Returns Type: `bool` `true` if the specified object is equal to the current property; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Returns a hash code for the current property. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current property. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the property. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the property name and type. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmReferentialConstraint Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmReferentialConstraint Represents a referential constraint that defines the relationship between properties in a navigation property. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmReferentialConstraint ``` ## Summary Represents a referential constraint that defines the relationship between properties in a navigation property. ## Remarks Referential constraints specify how foreign key relationships work in OData, mapping properties from the source entity to properties in the target entity. They are analogous to foreign key constraints in relational databases. ## Constructors ### .ctor Initializes a new instance of the [EdmReferentialConstraint](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmReferentialConstraint) class. #### Syntax ```csharp theme={"dark"} public EdmReferentialConstraint() ``` ### .ctor Initializes a new instance of the [EdmReferentialConstraint](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmReferentialConstraint) class with the specified property names. #### Syntax ```csharp theme={"dark"} public EdmReferentialConstraint(string property, string referencedProperty) ``` #### Parameters | Name | Type | Description | | - | - | - | | `property` | `string` | The name of the property in the source entity type. | | `referencedProperty` | `string` | The name of the referenced property in the target entity type. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *property* or *referencedProperty* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Property Gets or sets the name of the property in the source entity type. #### Syntax ```csharp theme={"dark"} public required string Property { get; set; } ``` #### Property Value Type: `string` The name of the property that acts as the foreign key in the source entity. #### Remarks This property references a property in the entity type that contains the navigation property. ### ReferencedProperty Gets or sets the name of the referenced property in the target entity type. #### Syntax ```csharp theme={"dark"} public required string ReferencedProperty { get; set; } ``` #### Property Value Type: `string` The name of the property in the target entity that is referenced by the foreign key. #### Remarks This is typically a key property in the target entity type. The relationship is established by matching the value of the Property with the ReferencedProperty. ## Methods ### Equals Determines whether the specified object is equal to the current referential constraint. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current referential constraint. | #### Returns Type: `bool` `true` if the specified object is equal to the current referential constraint; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Returns a hash code for the current referential constraint. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current referential constraint. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the referential constraint. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string showing the property mapping relationship. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # EdmSingleton Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmSingleton Represents a singleton in an OData entity container. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Models **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmSingleton ``` ## Summary Represents a singleton in an OData entity container. ## Remarks Singletons represent individual entity instances that are addressable as single resources rather than collections. They are useful for representing unique entities like service configuration, user profiles, or system settings that exist as single instances. ## Constructors ### .ctor Initializes a new instance of the [EdmSingleton](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmSingleton) class. #### Syntax ```csharp theme={"dark"} public EdmSingleton() ``` ### .ctor Initializes a new instance of the [EdmSingleton](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmSingleton) class with the specified name and type. #### Syntax ```csharp theme={"dark"} public EdmSingleton(string name, string type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of the singleton. | | `type` | `string` | The entity type of the singleton. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *name* or *type* is null or whitespace. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Annotations Gets or sets the annotations for this singleton. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Annotations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of annotations that provide additional metadata about the singleton. #### Remarks Annotations can be used to specify additional behaviors, constraints, or metadata that are not captured by the standard OData model elements. ### HasNavigationPropertyBindings Gets a value indicating whether this singleton has any navigation property bindings. #### Syntax ```csharp theme={"dark"} public bool HasNavigationPropertyBindings { get; } ``` #### Property Value Type: `bool` `true` if the singleton has navigation property bindings; otherwise, `false`. ### Name Gets or sets the name of the singleton. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The name used to address this singleton in OData URLs. #### Remarks The singleton name appears in the URL path when accessing the individual entity. ### NavigationPropertyBindings Gets or sets the navigation property bindings for this singleton. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List NavigationPropertyBindings { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of navigation property bindings that establish relationships with other entity sets or singletons. #### Remarks Navigation property bindings specify which entity set or singleton should be used when following a navigation property from this singleton. They establish the connections between related resources in the model. ### Type Gets or sets the entity type of the singleton. #### Syntax ```csharp theme={"dark"} public required string Type { get; set; } ``` #### Property Value Type: `string` The fully qualified name of the entity type for this singleton. #### Remarks The singleton instance must be of this entity type or one of its derived types. This determines the structure and properties available for the singleton. ### TypeName Gets the short name of the entity type (without namespace). #### Syntax ```csharp theme={"dark"} public string TypeName { get; } ``` #### Property Value Type: `string` The entity type name without the namespace prefix. ### TypeNamespace Gets the namespace of the entity type. #### Syntax ```csharp theme={"dark"} public string TypeNamespace { get; } ``` #### Property Value Type: `string` The namespace portion of the entity type, or an empty string if no namespace. ## Methods ### AddAnnotation Adds an annotation to this singleton. #### Syntax ```csharp theme={"dark"} public void AddAnnotation(string term, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | | `value` | `object` | The annotation value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *term* is null or whitespace. | ### AddNavigationPropertyBinding Adds a navigation property binding to this singleton. #### Syntax ```csharp theme={"dark"} public void AddNavigationPropertyBinding(string navigationPropertyPath, string target) ``` #### Parameters | Name | Type | Description | | - | - | - | | `navigationPropertyPath` | `string` | The path of the navigation property. | | `target` | `string` | The target entity set or singleton name. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *navigationPropertyPath* or *target* is null or whitespace. | ### Equals Determines whether the specified object is equal to the current singleton. #### Syntax ```csharp theme={"dark"} public override bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | The object to compare with the current singleton. | #### Returns Type: `bool` `true` if the specified object is equal to the current singleton; otherwise, `false`. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAnnotation Gets an annotation value by term. #### Syntax ```csharp theme={"dark"} public T GetAnnotation(string term) ``` #### Parameters | Name | Type | Description | | - | - | - | | `term` | `string` | The annotation term. | #### Returns Type: `T?` The annotation value, or the default value of *T* if not found. #### Type Parameters * `T` - The type of the annotation value. ### GetHashCode Returns a hash code for the current singleton. #### Syntax ```csharp theme={"dark"} public override int GetHashCode() ``` #### Returns Type: `int` A hash code for the current singleton. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetNavigationPropertyBinding Gets a navigation property binding by navigation property path. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding GetNavigationPropertyBinding(string navigationPropertyPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `navigationPropertyPath` | `string` | The path of the navigation property. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmNavigationPropertyBinding?` The navigation property binding with the specified path, or `null` if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveNavigationPropertyBinding Removes a navigation property binding from this singleton. #### Syntax ```csharp theme={"dark"} public bool RemoveNavigationPropertyBinding(string navigationPropertyPath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `navigationPropertyPath` | `string` | The path of the navigation property to remove. | #### Returns Type: `bool` `true` if the binding was removed; otherwise, `false`. ### ToString Returns a string representation of the singleton. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A string containing the singleton name and type. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/index Summary of the Microsoft.OData.Mcp.Core.Models Namespace ## Types ### Classes | Name | Summary | | - | - | | [EdmAction](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmAction) | Represents an action in the Entity Data Model. | | [EdmActionImport](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmActionImport) | Represents an action import in an OData entity container. | | [EdmComplexType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmComplexType) | Represents a complex type in an OData model. | | [EdmEntityContainer](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityContainer) | Represents an entity container in an OData model. | | [EdmEntitySet](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntitySet) | Represents an entity set in an OData entity container. | | [EdmEntityType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmEntityType) | Represents an entity type in an OData model. | | [EdmFunction](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunction) | Represents a function in the Entity Data Model. | | [EdmFunctionImport](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmFunctionImport) | Represents a function import in an OData entity container. | | [EdmModel](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmModel) | Represents a complete OData Entity Data Model (EDM). | | [EdmNavigationProperty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationProperty) | Represents a navigation property in an OData entity type. | | [EdmNavigationPropertyBinding](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmNavigationPropertyBinding) | Represents a navigation property binding in an entity set. | | [EdmParameter](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmParameter) | Represents a parameter in the Entity Data Model. | | [EdmPrimitiveType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmPrimitiveType) | Represents the EDM primitive types as defined in the OData specification. | | [EdmProperty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmProperty) | Represents a property in an OData entity type or complex type. | | [EdmReferentialConstraint](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmReferentialConstraint) | Represents a referential constraint that defines the relationship between properties in a navigation property. | | [EdmSingleton](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmSingleton) | Represents a singleton in an OData entity container. | ### Enums | Name | Summary | | - | - | | [EdmPrimitiveType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Models/EdmPrimitiveType) | Represents the EDM primitive types as defined in the OData specification. | # ODataMcpOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/ODataMcpOptions Configuration options for OData MCP integration. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.ODataMcpOptions ``` ## Summary Configuration options for OData MCP integration. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataMcpOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AllowedOrigins Gets or sets the allowed CORS origins. #### Syntax ```csharp theme={"dark"} public string[] AllowedOrigins { get; set; } ``` #### Property Value Type: `string[]` An array of allowed origins. Default allows all origins ("\*"). ### AutoDiscoverMetadata Gets or sets whether to auto-discover metadata. #### Syntax ```csharp theme={"dark"} public bool AutoDiscoverMetadata { get; set; } ``` #### Property Value Type: `bool` `true` to auto-discover metadata; otherwise, `false`. Default is `true`. ### AutoRegisterRoutes Gets or sets a value indicating whether to automatically register MCP endpoints for all OData routes. #### Syntax ```csharp theme={"dark"} public bool AutoRegisterRoutes { get; set; } ``` #### Property Value Type: `bool` `true` to automatically register MCP endpoints; otherwise, `false`. Default is `true`. ### BasePath Gets or sets the base path for MCP endpoints. #### Syntax ```csharp theme={"dark"} public string BasePath { get; set; } ``` #### Property Value Type: `string` The base path for MCP endpoints. Default is "/mcp". ### CacheDuration Gets or sets the cache duration for dynamic content. #### Syntax ```csharp theme={"dark"} public System.TimeSpan CacheDuration { get; set; } ``` #### Property Value Type: `System.TimeSpan` The duration to cache dynamic content. Default is 5 minutes. ### DefaultPageSize Gets or sets the default page size for query operations. #### Syntax ```csharp theme={"dark"} public int DefaultPageSize { get; set; } ``` #### Property Value Type: `int` The default page size. Default is 100. ### EnableCaching Gets or sets whether to enable caching. #### Syntax ```csharp theme={"dark"} public bool EnableCaching { get; set; } ``` #### Property Value Type: `bool` `true` to enable caching; otherwise, `false`. Default is `true`. ### EnableCors Gets or sets a value indicating whether to enable CORS for MCP endpoints. #### Syntax ```csharp theme={"dark"} public bool EnableCors { get; set; } ``` #### Property Value Type: `bool` `true` to enable CORS; otherwise, `false`. Default is `true`. ### Enabled Gets or sets whether to enable MCP endpoints. #### Syntax ```csharp theme={"dark"} public bool Enabled { get; set; } ``` #### Property Value Type: `bool` `true` to enable MCP endpoints; otherwise, `false`. Default is `true`. ### EnableDetailedErrors Gets or sets whether to enable detailed error messages. #### Syntax ```csharp theme={"dark"} public bool EnableDetailedErrors { get; set; } ``` #### Property Value Type: `bool` `true` to enable detailed error messages; otherwise, `false`. Default is `false`. ### EnableDynamicModels Gets or sets a value indicating whether to enable dynamic model updates. #### Syntax ```csharp theme={"dark"} public bool EnableDynamicModels { get; set; } ``` #### Property Value Type: `bool` `true` to enable dynamic models; otherwise, `false`. Default is `false` for performance. ### EnableRequestLogging Gets or sets a value indicating whether to enable request logging. #### Syntax ```csharp theme={"dark"} public bool EnableRequestLogging { get; set; } ``` #### Property Value Type: `bool` `true` to enable detailed request logging; otherwise, `false`. Default is `false`. ### ExcludeRoutes Gets or sets the routes to exclude from automatic MCP registration. #### Syntax ```csharp theme={"dark"} public string[] ExcludeRoutes { get; set; } ``` #### Property Value Type: `string[]` An array of route names to exclude. Default is an empty array. ### IncludeMetadata Gets or sets a value indicating whether to include metadata in tool descriptions. #### Syntax ```csharp theme={"dark"} public bool IncludeMetadata { get; set; } ``` #### Property Value Type: `bool` `true` to include detailed metadata; otherwise, `false`. Default is `true`. ### MaxPageSize Gets or sets the maximum page size for query operations. #### Syntax ```csharp theme={"dark"} public int MaxPageSize { get; set; } ``` #### Property Value Type: `int` The maximum page size. Default is 1000. ### MaxRequestSize Gets or sets the maximum request size for tool execution. #### Syntax ```csharp theme={"dark"} public long MaxRequestSize { get; set; } ``` #### Property Value Type: `long` The maximum request size in bytes. Default is 1MB (1,048,576 bytes). ### MaxToolsPerEntity Gets or sets the maximum number of tools to generate per entity. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxToolsPerEntity { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum number of tools per entity, or `null` for unlimited. Default is `null`. ### ModelRefreshInterval Gets or sets the interval for refreshing dynamic models. #### Syntax ```csharp theme={"dark"} public System.TimeSpan ModelRefreshInterval { get; set; } ``` #### Property Value Type: `System.TimeSpan` The interval for refreshing dynamic models. Default is 1 hour. ### RequestTimeout Gets or sets the request timeout. #### Syntax ```csharp theme={"dark"} public System.TimeSpan RequestTimeout { get; set; } ``` #### Property Value Type: `System.TimeSpan` The request timeout. Default is 2 minutes. ### ToolNamingPattern Gets or sets the tool naming pattern. #### Syntax ```csharp theme={"dark"} public string ToolNamingPattern { get; set; } ``` #### Property Value Type: `string` The pattern for generating tool names. Default is "..". Available placeholders: , , . ### UseAggressiveCaching Gets or sets a value indicating whether to use aggressive caching. #### Syntax ```csharp theme={"dark"} public bool UseAggressiveCaching { get; set; } ``` #### Property Value Type: `bool` `true` to use aggressive caching with ETags and long expiration; otherwise, `false`. Default is `true`. ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # CsdlParser Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Parsing/CsdlParser Parses OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Parsing **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Parsing.CsdlParser ``` ## Summary Parses OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models. ## Remarks This parser handles CSDL XML documents that describe the structure of OData services, including entity types, complex types, entity containers, and their relationships. It supports OData specification versions 4.0 and later. ## Constructors ### .ctor Initializes a new instance of the [CsdlParser](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Parsing/CsdlParser) class. #### Syntax ```csharp theme={"dark"} public CsdlParser() ``` ### .ctor Initializes a new instance of the [CsdlParser](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Parsing/CsdlParser) class with the specified logger. #### Syntax ```csharp theme={"dark"} public CsdlParser(Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger to use for diagnostic messages. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ParseFromFile Parses a CSDL XML document from a file. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromFile(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The path to the file containing the CSDL XML content. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmModel` The parsed EDM model. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *filePath* is null or whitespace. | | `FileNotFoundException` | Thrown when the file does not exist. | | `XmlException` | Thrown when the XML is malformed. | | `InvalidOperationException` | Thrown when the CSDL structure is invalid. | ### ParseFromStream Parses a CSDL XML document from a stream. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromStream(System.IO.Stream stream) ``` #### Parameters | Name | Type | Description | | - | - | - | | `stream` | `System.IO.Stream` | The stream containing the CSDL XML content. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmModel` The parsed EDM model. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *stream* is null. | | `XmlException` | Thrown when the XML is malformed. | | `InvalidOperationException` | Thrown when the CSDL structure is invalid. | ### ParseFromString Parses a CSDL XML document from a string. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromString(string csdlXml) ``` #### Parameters | Name | Type | Description | | - | - | - | | `csdlXml` | `string` | The CSDL XML content as a string. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmModel` The parsed EDM model. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *csdlXml* is null or whitespace. | | `XmlException` | Thrown when the XML is malformed. | | `InvalidOperationException` | Thrown when the CSDL structure is invalid. | ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser # ICsdlMetadataParser Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Parsing/ICsdlMetadataParser Interface for parsing OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Parsing ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser ``` ## Summary Interface for parsing OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models. ## Remarks This interface abstracts the parsing of CSDL XML documents that describe the structure of OData services, including entity types, complex types, entity containers, and their relationships. It supports OData specification versions 4.0 and later. ## Methods ### ParseFromFile Parses a CSDL XML document from a file. #### Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromFile(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The path to the file containing the CSDL XML content. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmModel` The parsed EDM model. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *filePath* is null or whitespace. | | `FileNotFoundException` | Thrown when the file does not exist. | | `XmlException` | Thrown when the XML is malformed. | | `InvalidOperationException` | Thrown when the CSDL structure is invalid. | ### ParseFromStream Parses a CSDL XML document from a stream. #### Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromStream(System.IO.Stream stream) ``` #### Parameters | Name | Type | Description | | - | - | - | | `stream` | `System.IO.Stream` | The stream containing the CSDL XML content. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmModel` The parsed EDM model. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *stream* is null. | | `XmlException` | Thrown when the XML is malformed. | | `InvalidOperationException` | Thrown when the CSDL structure is invalid. | ### ParseFromString Parses a CSDL XML document from a string. #### Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromString(string csdlXml) ``` #### Parameters | Name | Type | Description | | - | - | - | | `csdlXml` | `string` | The CSDL XML content as a string. | #### Returns Type: `Microsoft.OData.Mcp.Core.Models.EdmModel` The parsed EDM model. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *csdlXml* is null or whitespace. | | `XmlException` | Thrown when the XML is malformed. | | `InvalidOperationException` | Thrown when the CSDL structure is invalid. | # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Parsing/index Summary of the Microsoft.OData.Mcp.Core.Parsing Namespace ## Types ### Classes | Name | Summary | | - | - | | [CsdlParser](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Parsing/CsdlParser) | Parses OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models. | ### Interfaces | Name | Summary | | - | - | | [ICsdlMetadataParser](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Parsing/ICsdlMetadataParser) | Interface for parsing OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models. | # IMcpEndpointRegistry Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/IMcpEndpointRegistry Manages the registration and discovery of MCP endpoints. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Routing ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry ``` ## Summary Manages the registration and discovery of MCP endpoints. ## Methods ### GetAllEndpoints Gets all registered endpoints. #### Syntax ```csharp theme={"dark"} System.Collections.Generic.IEnumerable GetAllEndpoints() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of all registered endpoints. ### GetMcpUrl Gets the MCP URL for a given OData route. #### Syntax ```csharp theme={"dark"} string GetMcpUrl(string routeName, System.Nullable command = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `routeName` | `string` | The OData route name. | | `command` | `System.Nullable` | The MCP command (optional). | #### Returns Type: `string?` The MCP URL, or null if not found. ### HasEndpoint Checks if a route has an MCP endpoint registered. #### Syntax ```csharp theme={"dark"} bool HasEndpoint(string routeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `routeName` | `string` | The OData route name. | #### Returns Type: `bool` True if the route has an MCP endpoint; otherwise, false. ### Register Registers an MCP endpoint. #### Syntax ```csharp theme={"dark"} void Register(Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route) ``` #### Parameters | Name | Type | Description | | - | - | - | | `route` | `Microsoft.OData.Mcp.Core.Routing.McpRouteEntry` | The route entry to register. | ### TryGetEndpoint Attempts to get an endpoint by path. #### Syntax ```csharp theme={"dark"} bool TryGetEndpoint(string path, out Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route, out Microsoft.OData.Mcp.Core.Routing.McpCommand command) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `string` | The request path. | | `route` | `Microsoft.OData.Mcp.Core.Routing.McpRouteEntry?` | The matched route entry. | | `command` | `Microsoft.OData.Mcp.Core.Routing.McpCommand` | The MCP command. | #### Returns Type: `bool` True if an endpoint was found; otherwise, false. # McpCommand Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpCommand Represents the type of MCP command. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Routing **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Routing.McpCommand ``` ## Summary Represents the type of MCP command. ## Values | Name | Value | Description | | - | - | - | | `Unknown` | 0 | Unknown or invalid command. | | `Info` | 1 | Server information request (/mcp/info or /mcp). | | `Tools` | 2 | List all tools (/mcp/tools). | | `ToolsExecute` | 3 | Execute a tool (/mcp/tools/execute). | | `ToolInfo` | 4 | Get information about a specific tool (/mcp/tools/). | # McpEndpointRegistry Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpEndpointRegistry Default implementation of the MCP endpoint registry. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Routing **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Routing.McpEndpointRegistry ``` ## Summary Default implementation of the MCP endpoint registry. ## Remarks This implementation is thread-safe and optimized for concurrent access during application startup when multiple OData routes may be registered simultaneously. ## Constructors ### .ctor Initializes a new instance of the [McpEndpointRegistry](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpEndpointRegistry) class. #### Syntax ```csharp theme={"dark"} public McpEndpointRegistry() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAllEndpoints Gets all registered endpoints. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetAllEndpoints() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of all registered endpoints. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMcpUrl Gets the MCP URL for a given OData route. #### Syntax ```csharp theme={"dark"} public string GetMcpUrl(string routeName, System.Nullable command = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `routeName` | `string` | The OData route name. | | `command` | `System.Nullable` | The MCP command (optional). | #### Returns Type: `string?` The MCP URL, or null if not found. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasEndpoint Checks if a route has an MCP endpoint registered. #### Syntax ```csharp theme={"dark"} public bool HasEndpoint(string routeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `routeName` | `string` | The OData route name. | #### Returns Type: `bool` True if the route has an MCP endpoint; otherwise, false. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Register Registers an MCP endpoint. #### Syntax ```csharp theme={"dark"} public void Register(Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route) ``` #### Parameters | Name | Type | Description | | - | - | - | | `route` | `Microsoft.OData.Mcp.Core.Routing.McpRouteEntry` | The route entry to register. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *route* is null. | ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### TryGetEndpoint Attempts to get an endpoint by path. #### Syntax ```csharp theme={"dark"} public bool TryGetEndpoint(string path, out Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route, out Microsoft.OData.Mcp.Core.Routing.McpCommand command) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `string` | The request path. | | `route` | `Microsoft.OData.Mcp.Core.Routing.McpRouteEntry?` | The matched route entry. | | `command` | `Microsoft.OData.Mcp.Core.Routing.McpCommand` | The MCP command. | #### Returns Type: `bool` True if an endpoint was found; otherwise, false. ## Related APIs * Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry # McpRouteEntry Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpRouteEntry Represents an MCP route entry with its associated OData information. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Routing **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Routing.McpRouteEntry ``` ## Summary Represents an MCP route entry with its associated OData information. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public McpRouteEntry() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CustomMcpPath Gets the custom MCP path if one was specified. #### Syntax ```csharp theme={"dark"} public string CustomMcpPath { get; init; } ``` #### Property Value Type: `string?` ### IsExplicit Gets a value indicating whether this route was explicitly registered. #### Syntax ```csharp theme={"dark"} public bool IsExplicit { get; init; } ``` #### Property Value Type: `bool` ### McpBasePath Gets the base path for MCP endpoints (e.g., "/api/v1/mcp"). #### Syntax ```csharp theme={"dark"} public required string McpBasePath { get; init; } ``` #### Property Value Type: `string` ### Metadata Gets additional metadata about this route. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Metadata { get; init; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` ### ODataRoutePrefix Gets the OData route prefix (e.g., "api/v1", "odata", or empty for root). #### Syntax ```csharp theme={"dark"} public required string ODataRoutePrefix { get; init; } ``` #### Property Value Type: `string` ### RouteName Gets the name of the OData route. #### Syntax ```csharp theme={"dark"} public required string RouteName { get; init; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # McpRouteMatcher Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpRouteMatcher Efficiently matches MCP routes to their corresponding OData endpoints. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Routing **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Routing.McpRouteMatcher ``` ## Summary Efficiently matches MCP routes to their corresponding OData endpoints. ## Remarks This matcher is optimized for startup-time registration and runtime lookups using frozen collections for maximum performance. ## Constructors ### .ctor Initializes a new instance of the [McpRouteMatcher](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpRouteMatcher) class. #### Syntax ```csharp theme={"dark"} public McpRouteMatcher(System.Collections.Generic.IEnumerable routes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `routes` | `System.Collections.Generic.IEnumerable` | The routes to register. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *routes* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### BuildMcpUrl Builds the MCP URL for a given OData route. #### Syntax ```csharp theme={"dark"} public string BuildMcpUrl(string odataPrefix, System.Nullable command = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `odataPrefix` | `string` | The OData route prefix. | | `command` | `System.Nullable` | The MCP command (optional). | #### Returns Type: `string?` The MCP URL, or null if the route is not found. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetAllRoutes Gets all registered routes. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetAllRoutes() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of all registered route entries. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### TryGetRouteByODataPrefix Gets a route entry by its OData prefix. #### Syntax ```csharp theme={"dark"} public bool TryGetRouteByODataPrefix(string odataPrefix, out Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route) ``` #### Parameters | Name | Type | Description | | - | - | - | | `odataPrefix` | `string` | The OData route prefix. | | `route` | `Microsoft.OData.Mcp.Core.Routing.McpRouteEntry?` | The route entry if found. | #### Returns Type: `bool` True if the route was found; otherwise, false. ### TryMatch Attempts to match a request path to an MCP route. #### Syntax ```csharp theme={"dark"} public bool TryMatch(string path, out Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route, out Microsoft.OData.Mcp.Core.Routing.McpCommand mcpCommand) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `string` | The request path. | | `route` | `Microsoft.OData.Mcp.Core.Routing.McpRouteEntry?` | The matched route entry. | | `mcpCommand` | `Microsoft.OData.Mcp.Core.Routing.McpCommand` | The MCP command extracted from the path. | #### Returns Type: `bool` True if a route was matched; otherwise, false. # ODataRouteOptionsResolver Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/ODataRouteOptionsResolver Resolves OData route options to determine route patterns. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Routing **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Routing.ODataRouteOptionsResolver ``` ## Summary Resolves OData route options to determine route patterns. ## Constructors ### .ctor Initializes a new instance of the [ODataRouteOptionsResolver](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/ODataRouteOptionsResolver) class. #### Syntax ```csharp theme={"dark"} public ODataRouteOptionsResolver() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FormatQueryOption Formats a system query option based on dollar prefix settings. #### Syntax ```csharp theme={"dark"} public string FormatQueryOption(string option) ``` #### Parameters | Name | Type | Description | | - | - | - | | `option` | `string` | The option name without prefix (e.g., "filter", "select"). | #### Returns Type: `string` The formatted option name. ### GetBatchPath Gets the batch endpoint path based on OData options. #### Syntax ```csharp theme={"dark"} public string GetBatchPath() ``` #### Returns Type: `string` The batch path. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadataPath Gets the metadata endpoint path based on OData options. #### Syntax ```csharp theme={"dark"} public string GetMetadataPath() ``` #### Returns Type: `string` The metadata path. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### UsesDollarPrefix Determines whether dollar sign prefixes are enabled for OData routes. #### Syntax ```csharp theme={"dark"} public bool UsesDollarPrefix() ``` #### Returns Type: `bool` True if dollar prefixes are enabled; otherwise, false. # SpanRouteParser Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/SpanRouteParser High-performance route parser using ReadOnlySpan for zero-allocation parsing. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Routing **Inheritance:** System.ValueType ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Routing.SpanRouteParser ``` ## Summary High-performance route parser using ReadOnlySpan for zero-allocation parsing. ## Remarks This parser handles MCP routes in the format: //mcp/ where can be empty, and is optional. ## Constructors ### .ctor Initializes a new instance of the [SpanRouteParser](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/SpanRouteParser) struct. #### Syntax ```csharp theme={"dark"} public SpanRouteParser(System.ReadOnlySpan path) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `System.ReadOnlySpan` | The path to parse. | ## Methods ### IsMcpRoute Checks if the path is an MCP route without parsing details. #### Syntax ```csharp theme={"dark"} public bool IsMcpRoute() ``` #### Returns Type: `bool` True if this is an MCP route; otherwise, false. ### TryGetMcpCommand Gets the MCP command from the path. #### Syntax ```csharp theme={"dark"} public bool TryGetMcpCommand(out Microsoft.OData.Mcp.Core.Routing.McpCommand command) ``` #### Parameters | Name | Type | Description | | - | - | - | | `command` | `Microsoft.OData.Mcp.Core.Routing.McpCommand` | The MCP command. | #### Returns Type: `bool` True if a command was found; otherwise, false. ### TryGetODataRoute Extracts just the OData route portion from an MCP path. #### Syntax ```csharp theme={"dark"} public bool TryGetODataRoute(out System.ReadOnlySpan odataRoute) ``` #### Parameters | Name | Type | Description | | - | - | - | | `odataRoute` | `System.ReadOnlySpan` | The OData route prefix. | #### Returns Type: `bool` True if an OData route was found; otherwise, false. ### TryGetToolName Extracts the tool name from a tool info request path. #### Syntax ```csharp theme={"dark"} public bool TryGetToolName(out System.ReadOnlySpan toolName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `toolName` | `System.ReadOnlySpan` | The tool name. | #### Returns Type: `bool` True if a tool name was found; otherwise, false. ### TryParseMcpRoute Attempts to parse an MCP route from the path. #### Syntax ```csharp theme={"dark"} public bool TryParseMcpRoute(out System.ReadOnlySpan odataRoute, out System.ReadOnlySpan mcpCommand) ``` #### Parameters | Name | Type | Description | | - | - | - | | `odataRoute` | `System.ReadOnlySpan` | The OData route prefix, if found. | | `mcpCommand` | `System.ReadOnlySpan` | The MCP command, if specified. | #### Returns Type: `bool` True if this is an MCP route; otherwise, false. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/index Summary of the Microsoft.OData.Mcp.Core.Routing Namespace ## Types ### Classes | Name | Summary | | - | - | | [McpCommand](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpCommand) | Represents the type of MCP command. | | [McpEndpointRegistry](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpEndpointRegistry) | Default implementation of the MCP endpoint registry. | | [McpRouteEntry](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpRouteEntry) | Represents an MCP route entry with its associated OData information. | | [McpRouteMatcher](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpRouteMatcher) | Efficiently matches MCP routes to their corresponding OData endpoints. | | [ODataRouteOptionsResolver](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/ODataRouteOptionsResolver) | Resolves OData route options to determine route patterns. | | [SpanRouteParser](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/SpanRouteParser) | High-performance route parser using ReadOnlySpan for zero-allocation parsing. | ### Interfaces | Name | Summary | | - | - | | [IMcpEndpointRegistry](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/IMcpEndpointRegistry) | Manages the registration and discovery of MCP endpoints. | ### Enums | Name | Summary | | - | - | | [McpCommand](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Routing/McpCommand) | Represents the type of MCP command. | # DynamicODataMcpTools Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Server/DynamicODataMcpTools Dynamic OData MCP tools that generate methods based on discovered OData metadata. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Server **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Server.DynamicODataMcpTools ``` ## Summary Dynamic OData MCP tools that generate methods based on discovered OData metadata. ## Remarks This class provides dynamically generated MCP tools based on the structure of OData services. It discovers entity sets, operations, and schemas to create contextual tools for AI models. ## Constructors ### .ctor Initializes a new instance of the [DynamicODataMcpTools](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Server/DynamicODataMcpTools) class. #### Syntax ```csharp theme={"dark"} public DynamicODataMcpTools(System.Net.Http.IHttpClientFactory httpClientFactory, Microsoft.Extensions.Options.IOptions configuration, Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser metadataParser, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | The HTTP client factory. | | `configuration` | `Microsoft.Extensions.Options.IOptions` | The server configuration. | | `metadataParser` | `Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser` | The CSDL metadata parser. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### DescribeEntityType Gets detailed schema information for a specific entity type. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DescribeEntityType(string entityTypeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The name of the entity type to describe. | #### Returns Type: `System.Threading.Tasks.Task` Detailed schema information including properties, keys, and navigation properties. ### DiscoverEntitySets Discovers and lists all available entity sets in the OData service. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DiscoverEntitySets() ``` #### Returns Type: `System.Threading.Tasks.Task` A JSON array of entity set information including names and types. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GenerateQueryExamples Generates sample OData query URLs for a specific entity set. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GenerateQueryExamples(string entitySetName, bool includeAdvanced = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySetName` | `string` | The name of the entity set. | | `includeAdvanced` | `bool` | Whether to include advanced query examples. | #### Returns Type: `System.Threading.Tasks.Task` A collection of sample OData query URLs with explanations. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### ValidateQuery Validates an OData query URL against the service metadata. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ValidateQuery(string queryUrl) ``` #### Parameters | Name | Type | Description | | - | - | - | | `queryUrl` | `string` | The OData query URL to validate. | #### Returns Type: `System.Threading.Tasks.Task` Validation results including any errors or warnings. # ODataMcpTools Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Server/ODataMcpTools OData MCP tools using the official SDK attribute-based approach. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Server **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Server.ODataMcpTools ``` ## Summary OData MCP tools using the official SDK attribute-based approach. ## Remarks This class provides MCP tools for interacting with OData services using the official Model Context Protocol C# SDK patterns with attributes. ## Constructors ### .ctor Initializes a new instance of the [ODataMcpTools](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Server/ODataMcpTools) class. #### Syntax ```csharp theme={"dark"} public ODataMcpTools(System.Net.Http.IHttpClientFactory httpClientFactory, Microsoft.Extensions.Options.IOptions configuration, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | The HTTP client factory. | | `configuration` | `Microsoft.Extensions.Options.IOptions` | The server configuration. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### CreateEntity Creates a new entity in the specified OData entity set. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task CreateEntity(string entitySet, string entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `string` | The name of the entity set. | | `entity` | `string` | The entity data as JSON. | #### Returns Type: `System.Threading.Tasks.Task` The created entity as JSON. ### DeleteEntity Deletes an entity from the OData service. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task DeleteEntity(string entitySet, string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `string` | The entity set name. | | `key` | `string` | The entity key. | #### Returns Type: `System.Threading.Tasks.Task` Success message. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetEntity Gets a single entity by its key from an OData service. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GetEntity(string entitySet, string key, string select = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `string` | The name of the entity set. | | `key` | `string` | The entity key value as a string or number. | | `select` | `string?` | Optional comma-separated list of properties to select. | #### Returns Type: `System.Threading.Tasks.Task` The entity data as JSON. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadata Gets the OData service metadata document. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task GetMetadata() ``` #### Returns Type: `System.Threading.Tasks.Task` The OData metadata as XML. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### NavigateRelationship Navigates from a source entity to related entities via a navigation property. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task NavigateRelationship(string entitySet, string key, string navigationProperty) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `string` | The source entity set name. | | `key` | `string` | The source entity key. | | `navigationProperty` | `string` | The navigation property name. | #### Returns Type: `System.Threading.Tasks.Task` The related entities. ### QueryEntitySet Queries an OData entity set with optional filtering, sorting, and pagination. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task QueryEntitySet(string entitySet, string filter = null, string orderby = null, string select = null, System.Nullable top = null, System.Nullable skip = null, bool count = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `string` | The name of the entity set to query. | | `filter` | `string?` | Optional OData filter expression. | | `orderby` | `string?` | Optional OData orderby expression. | | `select` | `string?` | Optional comma-separated list of properties to select. | | `top` | `System.Nullable?` | Optional maximum number of results to return. | | `skip` | `System.Nullable?` | Optional number of results to skip for pagination. | | `count` | `bool` | Optional flag to include the total count of matching entities. | #### Returns Type: `System.Threading.Tasks.Task` The query results as JSON. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### UpdateEntity Updates an existing entity in the OData service. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task UpdateEntity(string entitySet, string key, string entity) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `string` | The entity set name. | | `key` | `string` | The entity key. | | `entity` | `string` | The updated entity data as JSON. | #### Returns Type: `System.Threading.Tasks.Task` The updated entity. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Server/index Summary of the Microsoft.OData.Mcp.Core.Server Namespace ## Types ### Classes | Name | Summary | | - | - | | [DynamicODataMcpTools](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Server/DynamicODataMcpTools) | Dynamic OData MCP tools that generate methods based on discovered OData metadata. | | [ODataMcpTools](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Server/ODataMcpTools) | OData MCP tools using the official SDK attribute-based approach. | # DynamicModelRefreshService Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Services/DynamicModelRefreshService Background service that refreshes OData models when dynamic models are enabled. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Services **Inheritance:** Microsoft.Extensions.Hosting.BackgroundService ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Services.DynamicModelRefreshService ``` ## Summary Background service that refreshes OData models when dynamic models are enabled. ## Constructors ### .ctor Initializes a new instance of the [DynamicModelRefreshService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Services/DynamicModelRefreshService) class. #### Syntax ```csharp theme={"dark"} public DynamicModelRefreshService(System.IServiceProvider serviceProvider, Microsoft.Extensions.Logging.ILogger logger, Microsoft.OData.Mcp.Core.ODataMcpOptions options) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceProvider` | `System.IServiceProvider` | The service provider. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger. | | `options` | `Microsoft.OData.Mcp.Core.ODataMcpOptions` | The MCP options. | # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Services/index Summary of the Microsoft.OData.Mcp.Core.Services Namespace ## Types ### Classes | Name | Summary | | - | - | | [DynamicModelRefreshService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Services/DynamicModelRefreshService) | Background service that refreshes OData models when dynamic models are enabled. | # IMcpToolFactory Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/IMcpToolFactory Factory for creating MCP tools dynamically from OData metadata. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory ``` ## Summary Factory for creating MCP tools dynamically from OData metadata. ## Remarks This factory generates MCP tools based on the parsed OData model, creating tools for CRUD operations, queries, and navigation between entities. The tools are generated dynamically to match the structure and capabilities of the OData service. ## Methods ### FilterToolsForUser Filters tools based on user authorization context. #### Syntax ```csharp theme={"dark"} System.Collections.Generic.IEnumerable FilterToolsForUser(System.Collections.Generic.IEnumerable tools, System.Collections.Generic.IEnumerable userScopes, System.Collections.Generic.IEnumerable userRoles, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tools` | `System.Collections.Generic.IEnumerable` | The tools to filter. | | `userScopes` | `System.Collections.Generic.IEnumerable` | The user's OAuth2 scopes. | | `userRoles` | `System.Collections.Generic.IEnumerable` | The user's roles. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for authorization filtering. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of tools the user is authorized to access. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *tools* is null. | ### GenerateCrudToolsAsync Generates CRUD operation tools for a specific entity type. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task> GenerateCrudToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to generate CRUD tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of CRUD tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityType* or *model* is null. | ### GenerateEntitySetToolsAsync Generates tools for entity set operations (collection-level operations). #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task> GenerateEntitySetToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to generate tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of entity set tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entitySet* or *model* is null. | ### GenerateEntityToolsAsync Generates MCP tools for a specific entity type. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task> GenerateEntityToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to generate tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of generated MCP tool definitions for the entity type. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityType* or *model* is null. | ### GenerateNavigationToolsAsync Generates navigation tools for entity relationships. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task> GenerateNavigationToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to generate navigation tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of navigation tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityType* or *model* is null. | ### GenerateQueryToolsAsync Generates query tools for the OData model. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task> GenerateQueryToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The OData model to generate query tools for. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of query tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *model* is null. | ### GenerateToolsAsync Generates all MCP tools for the specified OData model. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task> GenerateToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The OData model to generate tools for. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of generated MCP tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *model* is null. | ### GetAvailableToolNames Gets all available tool names. #### Syntax ```csharp theme={"dark"} System.Collections.Generic.IEnumerable GetAvailableToolNames() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of all tool names that have been generated. ### GetTool Gets the tool definition by name. #### Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolDefinition GetTool(string toolName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `toolName` | `string` | The name of the tool to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolDefinition?` The tool definition if found; otherwise, null. ### ValidateTools Validates that the generated tools are compatible with the MCP specification. #### Syntax ```csharp theme={"dark"} System.Collections.Generic.IEnumerable ValidateTools(System.Collections.Generic.IEnumerable tools) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tools` | `System.Collections.Generic.IEnumerable` | The tools to validate. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if all tools are valid. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *tools* is null. | # McpToolContext Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolContext Provides execution context for MCP tool operations. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolContext ``` ## Summary Provides execution context for MCP tool operations. ## Remarks This class encapsulates the runtime context needed for tool execution, including user identity, request metadata, and service dependencies. ## Constructors ### .ctor Initializes a new instance of the [McpToolContext](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolContext) class. #### Syntax ```csharp theme={"dark"} public McpToolContext() ``` ### .ctor Initializes a new instance of the [McpToolContext](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolContext) class with the specified model. #### Syntax ```csharp theme={"dark"} public McpToolContext(Microsoft.OData.Mcp.Core.Models.EdmModel model) ``` #### Parameters | Name | Type | Description | | - | - | - | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The OData model for this context. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *model* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthToken Gets or sets the authentication token to forward to the OData service. #### Syntax ```csharp theme={"dark"} public string AuthToken { get; set; } ``` #### Property Value Type: `string?` The bearer token to include in OData service requests. #### Remarks This token is forwarded to the OData service when the tool performs operations that require authentication. The token delegation strategy determines how this token is processed. ### CancellationToken Gets or sets the cancellation token for this request. #### Syntax ```csharp theme={"dark"} public System.Threading.CancellationToken CancellationToken { get; set; } ``` #### Property Value Type: `System.Threading.CancellationToken?` Token for cancelling long-running operations. #### Remarks Tools should respect this token and cancel operations appropriately when cancellation is requested. ### CorrelationId Gets or sets the correlation ID for this request. #### Syntax ```csharp theme={"dark"} public string CorrelationId { get; set; } ``` #### Property Value Type: `string` A unique identifier for tracking this request across systems. #### Remarks The correlation ID is used for logging, tracing, and debugging purposes. It should be propagated to downstream services for end-to-end tracking. ### HttpClientFactory Gets or sets the HTTP client factory for making service requests. #### Syntax ```csharp theme={"dark"} public System.Net.Http.IHttpClientFactory HttpClientFactory { get; set; } ``` #### Property Value Type: `System.Net.Http.IHttpClientFactory?` Factory for creating HTTP clients with proper configuration. #### Remarks Used to create HTTP clients for communicating with the OData service when authentication token delegation is required. ### MaxExecutionTime Gets or sets the maximum allowed execution time for the tool. #### Syntax ```csharp theme={"dark"} public System.TimeSpan MaxExecutionTime { get; set; } ``` #### Property Value Type: `System.TimeSpan?` The maximum time the tool is allowed to execute. #### Remarks This provides a safety mechanism to prevent tools from running indefinitely. Tools should monitor their execution time and stop gracefully when approaching this limit. ### Model Gets or sets the OData model for this execution context. #### Syntax ```csharp theme={"dark"} public required Microsoft.OData.Mcp.Core.Models.EdmModel Model { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Models.EdmModel` The complete OData model providing metadata context. #### Remarks The model contains all entity types, properties, relationships, and other metadata needed for tool execution and validation. ### Properties Gets or sets custom properties for tool execution. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Properties { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom key-value pairs for tool-specific data. #### Remarks This allows tools to store and retrieve custom context information that may be needed during execution. ### RequestTimestamp Gets or sets the request timestamp. #### Syntax ```csharp theme={"dark"} public System.DateTime RequestTimestamp { get; set; } ``` #### Property Value Type: `System.DateTime?` The UTC timestamp when the tool request was initiated. #### Remarks Used for auditing, performance tracking, and timeout calculations. ### ServiceBaseUrl Gets or sets the base URL of the OData service. #### Syntax ```csharp theme={"dark"} public string ServiceBaseUrl { get; set; } ``` #### Property Value Type: `string?` The base URL used for constructing OData requests. #### Remarks This URL is used when the tool needs to make HTTP requests to the underlying OData service for CRUD operations and queries. ### User Gets or sets the user identity making the request. #### Syntax ```csharp theme={"dark"} public System.Security.Claims.ClaimsPrincipal User { get; set; } ``` #### Property Value Type: `System.Security.Claims.ClaimsPrincipal?` The claims principal representing the authenticated user, or null for anonymous requests. #### Remarks This contains all claims and identity information from the JWT token, including user ID, scopes, roles, and other custom claims. ## Methods ### CreateServiceHttpClient Creates an HTTP client for making requests to the OData service. #### Syntax ```csharp theme={"dark"} public System.Net.Http.HttpClient CreateServiceHttpClient() ``` #### Returns Type: `System.Net.Http.HttpClient?` An HTTP client configured for OData service requests, or null if no factory is available. #### Remarks The returned client will include the authentication token if available. Callers are responsible for disposing the client. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetProperty Gets a custom property value. #### Syntax ```csharp theme={"dark"} public T GetProperty(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The property key. | #### Returns Type: `T?` The property value if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the property value. ### GetRemainingExecutionTime Gets the remaining execution time. #### Syntax ```csharp theme={"dark"} public System.TimeSpan GetRemainingExecutionTime() ``` #### Returns Type: `System.TimeSpan?` The remaining time before the execution limit is reached. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### GetUserEmail Gets the user's email from the claims. #### Syntax ```csharp theme={"dark"} public string GetUserEmail() ``` #### Returns Type: `string?` The user's email address, or null if not available. ### GetUserId Gets the user identifier from the claims. #### Syntax ```csharp theme={"dark"} public string GetUserId() ``` #### Returns Type: `string?` The user identifier, or null if not available. ### GetUserName Gets the user's display name from the claims. #### Syntax ```csharp theme={"dark"} public string GetUserName() ``` #### Returns Type: `string?` The user's display name, or null if not available. ### GetUserRoles Gets the user's roles from the claims. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetUserRoles() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of user roles, or empty if no roles are available. ### GetUserScopes Gets the user's OAuth2 scopes from the claims. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetUserScopes() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of OAuth2 scopes, or empty if no scopes are available. ### HasAnyScope Determines whether the user has any of the specified scopes. #### Syntax ```csharp theme={"dark"} public bool HasAnyScope(System.Collections.Generic.IEnumerable scopes) ``` #### Parameters | Name | Type | Description | | - | - | - | | `scopes` | `System.Collections.Generic.IEnumerable` | The scopes to check for. | #### Returns Type: `bool` `true` if the user has any of the specified scopes; otherwise, `false`. ### HasRole Determines whether the user has the specified role. #### Syntax ```csharp theme={"dark"} public bool HasRole(string role) ``` #### Parameters | Name | Type | Description | | - | - | - | | `role` | `string` | The role to check for. | #### Returns Type: `bool` `true` if the user has the specified role; otherwise, `false`. ### HasScope Determines whether the user has the specified scope. #### Syntax ```csharp theme={"dark"} public bool HasScope(string scope) ``` #### Parameters | Name | Type | Description | | - | - | - | | `scope` | `string` | The scope to check for. | #### Returns Type: `bool` `true` if the user has the specified scope; otherwise, `false`. ### IsExecutionTimeLimitExceeded Checks if the execution time limit has been exceeded. #### Syntax ```csharp theme={"dark"} public bool IsExecutionTimeLimitExceeded() ``` #### Returns Type: `bool` `true` if the execution time limit has been exceeded; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetProperty Sets a custom property value. #### Syntax ```csharp theme={"dark"} public void SetProperty(string key, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The property key. | | `value` | `object` | The property value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # McpToolDefinition Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolDefinition Represents a complete MCP tool definition with metadata and implementation details. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolDefinition ``` ## Summary Represents a complete MCP tool definition with metadata and implementation details. ## Remarks This class encapsulates all information needed to register and execute an MCP tool, including its schema, parameters, authorization requirements, and execution context. ## Constructors ### .ctor Initializes a new instance of the [McpToolDefinition](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolDefinition) class. #### Syntax ```csharp theme={"dark"} public McpToolDefinition() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Category Gets or sets the tool category. #### Syntax ```csharp theme={"dark"} public required string Category { get; set; } ``` #### Property Value Type: `string` The category that groups related tools together. #### Remarks Common categories include "CRUD", "Query", "Navigation", and "Batch". Categories help organize tools and can be used for filtering and authorization. ### CreatedAt Gets or sets the time when this tool definition was created. #### Syntax ```csharp theme={"dark"} public System.DateTime CreatedAt { get; set; } ``` #### Property Value Type: `System.DateTime` The UTC timestamp when the tool was generated. #### Remarks This timestamp is used for caching, versioning, and audit purposes. ### DeprecationMessage Gets or sets the deprecation message for deprecated tools. #### Syntax ```csharp theme={"dark"} public string DeprecationMessage { get; set; } ``` #### Property Value Type: `string?` A message explaining why the tool is deprecated and what should be used instead. #### Remarks This message is shown to users when they attempt to use a deprecated tool, guiding them to better alternatives. ### Description Gets or sets the human-readable description of the tool. #### Syntax ```csharp theme={"dark"} public required string Description { get; set; } ``` #### Property Value Type: `string` A description explaining what the tool does and how to use it. #### Remarks This description is used by AI models to understand the tool's purpose and determine when it should be used. ### Examples Gets or sets example usage scenarios for the tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Examples { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of example usage patterns. #### Remarks Examples help AI models understand how to use the tool effectively and provide better assistance to users. ### Handler Gets or sets the tool implementation handler. #### Syntax ```csharp theme={"dark"} public required System.Func> Handler { get; set; } ``` #### Property Value Type: `System.Func>` The function that executes the tool logic. #### Remarks This is the actual implementation that gets called when the tool is invoked. It receives the tool context and parameters, and returns the execution result. ### InputSchema Gets or sets the input schema for the tool parameters. #### Syntax ```csharp theme={"dark"} public required System.Text.Json.JsonDocument InputSchema { get; set; } ``` #### Property Value Type: `System.Text.Json.JsonDocument` A JSON schema document defining the tool's input parameters. #### Remarks This schema is used by MCP clients to validate input and provide type-safe parameter binding. It should follow JSON Schema specification. ### IsDeprecated Gets or sets a value indicating whether this tool is deprecated. #### Syntax ```csharp theme={"dark"} public bool IsDeprecated { get; set; } ``` #### Property Value Type: `bool` `true` if the tool is deprecated; otherwise, `false`. #### Remarks Deprecated tools are still functional but should be avoided in favor of newer alternatives. They may be removed in future versions. ### Metadata Gets or sets additional metadata for the tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom metadata key-value pairs. #### Remarks This can include information such as rate limits, caching behavior, or other tool-specific configuration data. ### Name Gets or sets the unique name of the tool. #### Syntax ```csharp theme={"dark"} public required string Name { get; set; } ``` #### Property Value Type: `string` The tool name as it will appear in the MCP protocol. #### Remarks Tool names must be unique within the MCP server and should follow naming conventions that clearly indicate their purpose and target entity. ### OperationType Gets or sets the operation type for this tool. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Tools.McpToolOperationType OperationType { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Tools.McpToolOperationType` The type of operation this tool performs. #### Remarks Operation types are used for authorization and auditing. They indicate the level of data access and modification the tool performs. ### OutputSchema Gets or sets the output schema for the tool results. #### Syntax ```csharp theme={"dark"} public System.Text.Json.JsonDocument OutputSchema { get; set; } ``` #### Property Value Type: `System.Text.Json.JsonDocument?` A JSON schema document defining the tool's output format. #### Remarks This schema describes the structure of the tool's return value, helping clients understand and process the results. ### RequiredRoles Gets or sets the required roles for this tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List RequiredRoles { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of roles that users must have to use this tool. #### Remarks This provides role-based authorization control in addition to or instead of scope-based authorization. ### RequiredScopes Gets or sets the required OAuth2 scopes for this tool. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List RequiredScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of OAuth2 scopes that users must have to use this tool. #### Remarks Users must have at least one of these scopes to execute the tool. This provides fine-grained authorization control based on OAuth2 tokens. ### SupportsBatch Gets or sets a value indicating whether this tool supports batch operations. #### Syntax ```csharp theme={"dark"} public bool SupportsBatch { get; set; } ``` #### Property Value Type: `bool` `true` if the tool can process multiple items in a single call; otherwise, `false`. #### Remarks Batch-enabled tools can improve performance by processing multiple operations in a single request to the underlying OData service. ### TargetEntitySet Gets or sets the target entity set for entity set-specific tools. #### Syntax ```csharp theme={"dark"} public string TargetEntitySet { get; set; } ``` #### Property Value Type: `string?` The name of the target entity set, or null for entity type tools. #### Remarks This is used for tools that operate on specific entity sets, which may have different permissions or configurations than the entity type. ### TargetEntityType Gets or sets the target entity type for entity-specific tools. #### Syntax ```csharp theme={"dark"} public string TargetEntityType { get; set; } ``` #### Property Value Type: `string?` The fully qualified name of the target entity type, or null for general tools. #### Remarks This is used for entity-specific tools to identify which OData entity type the tool operates on. General tools that work across entities should leave this null. ### Version Gets or sets the version of the tool. #### Syntax ```csharp theme={"dark"} public string Version { get; set; } ``` #### Property Value Type: `string` The version string for this tool definition. #### Remarks Tool versions help track changes and ensure compatibility. They should follow semantic versioning principles. ## Methods ### AddExample Adds an example to the tool definition. #### Syntax ```csharp theme={"dark"} public void AddExample(string title, string description, System.Text.Json.JsonDocument input, System.Text.Json.JsonDocument expectedOutput = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `title` | `string` | The example title. | | `description` | `string` | The example description. | | `input` | `System.Text.Json.JsonDocument` | The example input parameters. | | `expectedOutput` | `System.Text.Json.JsonDocument?` | The expected output (optional). | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *title* is null or whitespace. | | `ArgumentNullException` | Thrown when *input* is null. | ### AddMetadata Adds metadata to the tool definition. #### Syntax ```csharp theme={"dark"} public void AddMetadata(string key, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | | `value` | `object` | The metadata value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### CreateCrudTool Creates a basic CRUD tool definition. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolDefinition CreateCrudTool(string name, string description, Microsoft.OData.Mcp.Core.Tools.McpToolOperationType operationType, string entityType, System.Text.Json.JsonDocument inputSchema, System.Func> handler, string entitySet = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The tool name. | | `description` | `string` | The tool description. | | `operationType` | `Microsoft.OData.Mcp.Core.Tools.McpToolOperationType` | The operation type. | | `entityType` | `string` | The target entity type. | | `inputSchema` | `System.Text.Json.JsonDocument` | The input schema. | | `handler` | `System.Func>` | The tool handler. | | `entitySet` | `string?` | The optional entity set name for the entity type. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolDefinition` A new tool definition for CRUD operations. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when required parameters are null or empty. | | `ArgumentNullException` | Thrown when *inputSchema* or *handler* is null. | ### CreateQueryTool Creates a query tool definition. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolDefinition CreateQueryTool(string name, string description, System.Text.Json.JsonDocument inputSchema, System.Func> handler) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The tool name. | | `description` | `string` | The tool description. | | `inputSchema` | `System.Text.Json.JsonDocument` | The input schema. | | `handler` | `System.Func>` | The tool handler. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolDefinition` A new tool definition for query operations. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when required parameters are null or empty. | | `ArgumentNullException` | Thrown when *inputSchema* or *handler* is null. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadata Gets metadata value by key. #### Syntax ```csharp theme={"dark"} public T GetMetadata(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | #### Returns Type: `T?` The metadata value if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the metadata value. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### IsAuthorizedForUser Determines whether the tool is authorized for the specified user context. #### Syntax ```csharp theme={"dark"} public bool IsAuthorizedForUser(System.Collections.Generic.IEnumerable userScopes, System.Collections.Generic.IEnumerable userRoles) ``` #### Parameters | Name | Type | Description | | - | - | - | | `userScopes` | `System.Collections.Generic.IEnumerable` | The user's OAuth2 scopes. | | `userRoles` | `System.Collections.Generic.IEnumerable` | The user's roles. | #### Returns Type: `bool` `true` if the user is authorized to use this tool; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the tool definition. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the tool definition. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the tool definition for completeness and correctness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the tool is valid. # McpToolExample Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolExample Represents an example usage pattern for an MCP tool. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolExample ``` ## Summary Represents an example usage pattern for an MCP tool. ## Remarks Examples help AI models understand how to use tools effectively and provide better assistance to users by demonstrating common usage patterns. ## Constructors ### .ctor Initializes a new instance of the [McpToolExample](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolExample) class. #### Syntax ```csharp theme={"dark"} public McpToolExample() ``` ### .ctor Initializes a new instance of the [McpToolExample](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolExample) class with basic information. #### Syntax ```csharp theme={"dark"} public McpToolExample(string title, System.Text.Json.JsonDocument input) ``` #### Parameters | Name | Type | Description | | - | - | - | | `title` | `string` | The example title. | | `input` | `System.Text.Json.JsonDocument` | The example input parameters. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *title* is null or whitespace. | | `ArgumentNullException` | Thrown when *input* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Category Gets or sets the scenario category for this example. #### Syntax ```csharp theme={"dark"} public string Category { get; set; } ``` #### Property Value Type: `string` The category that groups related examples together. #### Remarks Common categories include "Basic Usage", "Advanced Queries", "Error Handling", "Performance Optimization", etc. This helps organize examples by complexity or purpose. ### Description Gets or sets the description of the example. #### Syntax ```csharp theme={"dark"} public string Description { get; set; } ``` #### Property Value Type: `string` A detailed description explaining the example's purpose and context. #### Remarks The description should provide context about when and why this example would be useful, including any prerequisites or assumptions. ### Difficulty Gets or sets the difficulty level of this example. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Tools.McpToolExampleDifficulty Difficulty { get; set; } ``` #### Property Value Type: `Microsoft.OData.Mcp.Core.Tools.McpToolExampleDifficulty` The complexity level of the example. #### Remarks Difficulty levels help users and AI models choose appropriate examples based on their experience and needs. ### ExpectedExecutionTime Gets or sets the expected execution time for this example. #### Syntax ```csharp theme={"dark"} public System.Nullable ExpectedExecutionTime { get; set; } ``` #### Property Value Type: `System.Nullable` The approximate time this example should take to execute. #### Remarks This helps set expectations and can be used for performance monitoring and timeout configuration. ### ExpectedOutput Gets or sets the expected output for this example. #### Syntax ```csharp theme={"dark"} public System.Text.Json.JsonDocument ExpectedOutput { get; set; } ``` #### Property Value Type: `System.Text.Json.JsonDocument?` A JSON document showing the expected result, or null if not provided. #### Remarks Expected output helps users understand what to expect from the tool and can be used for testing and validation purposes. ### Input Gets or sets the example input parameters. #### Syntax ```csharp theme={"dark"} public required System.Text.Json.JsonDocument Input { get; set; } ``` #### Property Value Type: `System.Text.Json.JsonDocument` A JSON document containing the example input parameters. #### Remarks The input should be a complete, valid example that demonstrates the tool's parameter schema and typical usage patterns. ### Notes Gets or sets additional notes about this example. #### Syntax ```csharp theme={"dark"} public string Notes { get; set; } ``` #### Property Value Type: `string?` Free-form notes providing additional context or warnings. #### Remarks Notes can include tips, warnings about edge cases, performance considerations, or links to related documentation. ### Prerequisites Gets or sets the prerequisites for this example. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Prerequisites { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A list of conditions that must be met for this example to work. #### Remarks Prerequisites might include required permissions, data setup, configuration settings, or other dependencies. ### RequiresAuthentication Gets or sets a value indicating whether this example requires authentication. #### Syntax ```csharp theme={"dark"} public bool RequiresAuthentication { get; set; } ``` #### Property Value Type: `bool` `true` if authentication is required; otherwise, `false`. #### Remarks This flag helps users and AI models understand whether they need to provide authentication credentials to use this example. ### Tags Gets or sets the tags associated with this example. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Tags { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of tags for categorizing and searching examples. #### Remarks Tags provide flexible categorization beyond the main category, allowing for cross-cutting concerns like "authentication", "pagination", "bulk-operations", etc. ### Title Gets or sets the title of the example. #### Syntax ```csharp theme={"dark"} public required string Title { get; set; } ``` #### Property Value Type: `string` A brief, descriptive title for the example. #### Remarks The title should clearly indicate what the example demonstrates, such as "Create a new customer" or "Query products by category". ## Methods ### AddPrerequisite Adds a prerequisite to this example. #### Syntax ```csharp theme={"dark"} public void AddPrerequisite(string prerequisite) ``` #### Parameters | Name | Type | Description | | - | - | - | | `prerequisite` | `string` | The prerequisite to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *prerequisite* is null or whitespace. | ### AddTag Adds a tag to this example. #### Syntax ```csharp theme={"dark"} public void AddTag(string tag) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tag` | `string` | The tag to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *tag* is null or whitespace. | ### AddTags Adds multiple tags to this example. #### Syntax ```csharp theme={"dark"} public void AddTags(params string[] tags) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tags` | `string[]` | The tags to add. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *tags* is null. | ### Clone Creates a deep copy of this example. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Tools.McpToolExample Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolExample` A new instance that is a copy of this example. ### Create Creates a basic example with the specified title and input. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolExample Create(string title, object input, string description = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `title` | `string` | The example title. | | `input` | `object` | The input object to serialize to JSON. | | `description` | `string?` | Optional description of the example. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolExample` A new tool example. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *title* is null or whitespace. | | `ArgumentNullException` | Thrown when *input* is null. | ### CreateWithOutput Creates an example with expected output. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolExample CreateWithOutput(string title, object input, object expectedOutput, string description = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `title` | `string` | The example title. | | `input` | `object` | The input object to serialize to JSON. | | `expectedOutput` | `object` | The expected output object to serialize to JSON. | | `description` | `string?` | Optional description of the example. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolExample` A new tool example with expected output. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *title* is null or whitespace. | | `ArgumentNullException` | Thrown when *input* or *expectedOutput* is null. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetExpectedOutputJson Gets the expected output as a formatted JSON string. #### Syntax ```csharp theme={"dark"} public string GetExpectedOutputJson(bool indent = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `indent` | `bool` | Whether to indent the JSON for readability. | #### Returns Type: `string?` The expected output as a JSON string, or null if no expected output is defined. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetInputJson Gets the input as a formatted JSON string. #### Syntax ```csharp theme={"dark"} public string GetInputJson(bool indent = true) ``` #### Parameters | Name | Type | Description | | - | - | - | | `indent` | `bool` | Whether to indent the JSON for readability. | #### Returns Type: `string` The input parameters as a JSON string. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasTag Determines whether this example has the specified tag. #### Syntax ```csharp theme={"dark"} public bool HasTag(string tag) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tag` | `string` | The tag to check for. | #### Returns Type: `bool` `true` if the example has the specified tag; otherwise, `false`. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Returns a string representation of the example. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A summary of the example. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the example for completeness and correctness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the example is valid. # McpToolExampleDifficulty Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolExampleDifficulty Defines the difficulty levels for MCP tool examples. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolExampleDifficulty ``` ## Summary Defines the difficulty levels for MCP tool examples. ## Values | Name | Value | Description | | - | - | - | | `Beginner` | 0 | Beginner-level example suitable for new users. | | `Intermediate` | 1 | Intermediate-level example requiring some experience. | | `Advanced` | 2 | Advanced-level example for experienced users. | | `Expert` | 3 | Expert-level example for complex scenarios. | # McpToolFactory Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolFactory Factory for creating MCP tools dynamically from OData metadata. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolFactory ``` ## Summary Factory for creating MCP tools dynamically from OData metadata. ## Remarks This factory generates MCP tools based on the parsed OData model, creating tools for CRUD operations, queries, and navigation between entities. The tools are generated dynamically to match the structure and capabilities of the OData service. ## Constructors ### .ctor Initializes a new instance of the [McpToolFactory](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolFactory) class. #### Syntax ```csharp theme={"dark"} public McpToolFactory(Microsoft.Extensions.Logging.ILogger logger, System.Net.Http.IHttpClientFactory httpClientFactory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | | `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | The HTTP client factory for OData requests. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *logger* or *httpClientFactory* is null. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### BuildDefaultSelectForEntityType Builds a default \$select statement for an entity type, excluding binary and stream fields. #### Syntax ```csharp theme={"dark"} public static string BuildDefaultSelectForEntityType(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to build the select for. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | The generation options. | #### Returns Type: `string?` A comma-separated list of property names to select, or null if all properties should be included. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FilterToolsForUser Filters tools based on user authorization context. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable FilterToolsForUser(System.Collections.Generic.IEnumerable tools, System.Collections.Generic.IEnumerable userScopes, System.Collections.Generic.IEnumerable userRoles, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tools` | `System.Collections.Generic.IEnumerable` | The tools to filter. | | `userScopes` | `System.Collections.Generic.IEnumerable` | The user's OAuth2 scopes. | | `userRoles` | `System.Collections.Generic.IEnumerable` | The user's roles. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for authorization filtering. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of tools the user is authorized to access. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *tools* is null. | ### GenerateCrudToolsAsync Generates CRUD operation tools for a specific entity type. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateCrudToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to generate CRUD tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of CRUD tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityType* or *model* is null. | ### GenerateEntitySetToolsAsync Generates tools for entity set operations (collection-level operations). #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateEntitySetToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntitySet entitySet, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Mcp.Core.Models.EdmEntitySet` | The entity set to generate tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of entity set tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entitySet* or *model* is null. | ### GenerateEntityToolsAsync Generates MCP tools for a specific entity type. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateEntityToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to generate tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of generated MCP tool definitions for the entity type. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityType* or *model* is null. | ### GenerateNavigationToolsAsync Generates navigation tools for entity relationships. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateNavigationToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType, Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type to generate navigation tools for. | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The complete OData model for context. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of navigation tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *entityType* or *model* is null. | ### GenerateQueryToolsAsync Generates query tools for the OData model. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateQueryToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The OData model to generate query tools for. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of query tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *model* is null. | ### GenerateToolsAsync Generates all MCP tools for the specified OData model. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task> GenerateToolsAsync(Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions options = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The OData model to generate tools for. | | `options` | `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions?` | Options for tool generation. | #### Returns Type: `System.Threading.Tasks.Task>` A collection of generated MCP tool definitions. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *model* is null. | ### GetAvailableToolNames Gets all available tool names. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetAvailableToolNames() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of all tool names that have been generated. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetTool Gets the tool definition by name. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Tools.McpToolDefinition GetTool(string toolName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `toolName` | `string` | The name of the tool to retrieve. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolDefinition?` The tool definition if found; otherwise, null. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### IsBinaryOrStreamField Determines if a property is a binary or stream field that should be excluded by default. #### Syntax ```csharp theme={"dark"} public static bool IsBinaryOrStreamField(Microsoft.OData.Mcp.Core.Models.EdmProperty property) ``` #### Parameters | Name | Type | Description | | - | - | - | | `property` | `Microsoft.OData.Mcp.Core.Models.EdmProperty` | The property to check. | #### Returns Type: `bool` True if the property is a binary or stream field; otherwise, false. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### ValidateTools Validates that the generated tools are compatible with the MCP specification. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable ValidateTools(System.Collections.Generic.IEnumerable tools) ``` #### Parameters | Name | Type | Description | | - | - | - | | `tools` | `System.Collections.Generic.IEnumerable` | The tools to validate. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if all tools are valid. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *tools* is null. | ## Related APIs * Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory # McpToolGenerationOptions Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolGenerationOptions Configuration options for MCP tool generation. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions ``` ## Summary Configuration options for MCP tool generation. ## Remarks These options control how tools are generated from OData metadata, including which operations to include, authorization requirements, and performance optimizations. ## Constructors ### .ctor Initializes a new instance of the [McpToolGenerationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolGenerationOptions) class. #### Syntax ```csharp theme={"dark"} public McpToolGenerationOptions() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AlwaysExcludePropertyTypes Gets or sets the list of property types that should always be excluded from default selections. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List AlwaysExcludePropertyTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A list of EDM type names to exclude. #### Remarks This list allows customization of which property types are automatically excluded from default \$select statements. Common values include "Edm.Binary", "Edm.Stream", and potentially large geographic data types. ### CustomMetadata Gets or sets custom metadata to include in all generated tools. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary CustomMetadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of custom metadata key-value pairs. #### Remarks This metadata will be added to all generated tools and can be used for custom processing or filtering logic. ### DefaultRequiredRoles Gets or sets the default required roles for generated tools. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DefaultRequiredRoles { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of roles required by default for all tools. #### Remarks These roles will be added to all generated tools unless overridden by entity-specific or operation-specific role configurations. ### DefaultRequiredScopes Gets or sets the default required scopes for generated tools. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List DefaultRequiredScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of OAuth2 scopes required by default for all tools. #### Remarks These scopes will be added to all generated tools unless overridden by entity-specific or operation-specific scope configurations. ### EntityScopes Gets or sets entity-specific scope requirements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> EntityScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A dictionary mapping entity type names to their required scopes. #### Remarks This allows configuring different authorization requirements for different entity types. Entity type names should be fully qualified. ### ExcludeBinaryFieldsByDefault Gets or sets a value indicating whether to exclude binary and stream fields from default \$select statements. #### Syntax ```csharp theme={"dark"} public bool ExcludeBinaryFieldsByDefault { get; set; } ``` #### Property Value Type: `bool` `true` to exclude binary fields by default; otherwise, `false`. #### Remarks When enabled, properties of type Edm.Binary and Edm.Stream will be automatically excluded from list operations unless explicitly included in the \$select parameter. This helps prevent large binary data from overwhelming the response and improves performance. ### ExcludeEntityTypes Gets or sets the entity types to exclude from tool generation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet ExcludeEntityTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of entity type names to exclude. #### Remarks Entity types listed here will be excluded from tool generation even if they would otherwise be included. This takes precedence over the IncludeEntityTypes setting. ### ExcludeOperations Gets or sets the operations to exclude for each entity type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet ExcludeOperations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of operation types to exclude. #### Remarks Operations listed here will be excluded from tool generation. This takes precedence over the IncludeOperations setting. ### GenerateBatchTools Gets or sets a value indicating whether to generate batch operation tools. #### Syntax ```csharp theme={"dark"} public bool GenerateBatchTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate batch tools; otherwise, `false`. #### Remarks Batch tools allow processing multiple operations in a single request, improving performance for bulk operations. ### GenerateCrudTools Gets or sets a value indicating whether to generate CRUD tools for entity types. #### Syntax ```csharp theme={"dark"} public bool GenerateCrudTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate CRUD tools; otherwise, `false`. #### Remarks CRUD tools provide basic Create, Read, Update, and Delete operations for each entity type in the OData model. ### GenerateEntitySetTools Gets or sets a value indicating whether to generate tools for entity sets. #### Syntax ```csharp theme={"dark"} public bool GenerateEntitySetTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate entity set tools; otherwise, `false`. #### Remarks Entity set tools operate on collections of entities and may have different permissions or behaviors than individual entity tools. ### GenerateNavigationTools Gets or sets a value indicating whether to generate navigation tools. #### Syntax ```csharp theme={"dark"} public bool GenerateNavigationTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate navigation tools; otherwise, `false`. #### Remarks Navigation tools allow traversing relationships between entities, following navigation properties defined in the OData model. ### GenerateQueryTools Gets or sets a value indicating whether to generate query tools. #### Syntax ```csharp theme={"dark"} public bool GenerateQueryTools { get; set; } ``` #### Property Value Type: `bool` `true` to generate query tools; otherwise, `false`. #### Remarks Query tools provide advanced search and filtering capabilities using OData query syntax like $filter, $orderby, $select, and $expand. ### IncludeDetailedSchemas Gets or sets a value indicating whether to include detailed property schemas. #### Syntax ```csharp theme={"dark"} public bool IncludeDetailedSchemas { get; set; } ``` #### Property Value Type: `bool` `true` to include detailed schemas; otherwise, `false`. #### Remarks Detailed schemas provide full type information and validation rules but result in larger tool definitions and longer generation times. ### IncludeEntityTypes Gets or sets the entity types to include in tool generation. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet IncludeEntityTypes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of entity type names to include, or empty to include all. #### Remarks When specified, only tools for the listed entity types will be generated. If empty, tools will be generated for all entity types in the model. Entity type names should be fully qualified (e.g., "MyNamespace.Customer"). ### IncludeExamples Gets or sets a value indicating whether to include examples in generated tools. #### Syntax ```csharp theme={"dark"} public bool IncludeExamples { get; set; } ``` #### Property Value Type: `bool` `true` to include examples; otherwise, `false`. #### Remarks Examples help AI models understand how to use the tools effectively but increase the size of the tool definitions. ### IncludeOperations Gets or sets the operations to include for each entity type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.HashSet IncludeOperations { get; set; } ``` #### Property Value Type: `System.Collections.Generic.HashSet` A collection of operation types to include. #### Remarks This allows fine-grained control over which operations are available for each entity type. If empty, all supported operations will be included. ### MaxNavigationDepth Gets or sets the maximum depth for navigation property traversal. #### Syntax ```csharp theme={"dark"} public int MaxNavigationDepth { get; set; } ``` #### Property Value Type: `int` The maximum depth for following navigation properties. #### Remarks This prevents infinite recursion when generating navigation tools for models with circular references. ### MaxToolCount Gets or sets the maximum number of tools to generate. #### Syntax ```csharp theme={"dark"} public System.Nullable MaxToolCount { get; set; } ``` #### Property Value Type: `System.Nullable` The maximum number of tools to generate, or null for no limit. #### Remarks This setting can be used to prevent generation of too many tools from very large OData models, which could impact performance. ### OperationScopes Gets or sets operation-specific scope requirements. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary> OperationScopes { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary>` A dictionary mapping operation types to their required scopes. #### Remarks This allows configuring different authorization requirements for different operation types (e.g., read vs. write operations). ### OptimizeForPerformance Gets or sets a value indicating whether to optimize for performance. #### Syntax ```csharp theme={"dark"} public bool OptimizeForPerformance { get; set; } ``` #### Property Value Type: `bool` `true` to optimize for performance; otherwise, `false`. #### Remarks Performance optimization may reduce the number of generated tools or simplify their schemas to improve runtime performance. ### ToolNamePrefix Gets or sets the tool name prefix. #### Syntax ```csharp theme={"dark"} public string ToolNamePrefix { get; set; } ``` #### Property Value Type: `string` A prefix to add to all generated tool names. #### Remarks The prefix helps avoid naming conflicts when multiple OData services are exposed through the same MCP server. ### ToolNameSuffix Gets or sets the tool name suffix. #### Syntax ```csharp theme={"dark"} public string ToolNameSuffix { get; set; } ``` #### Property Value Type: `string` A suffix to add to all generated tool names. #### Remarks The suffix can be used for versioning or other organizational purposes. ### ToolVersion Gets or sets the tool version for generated tools. #### Syntax ```csharp theme={"dark"} public string ToolVersion { get; set; } ``` #### Property Value Type: `string` The version string to assign to generated tools. #### Remarks This version is used for tool identification and compatibility checking. It should follow semantic versioning principles. ## Methods ### Clone Creates a copy of these options. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions Clone() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions` A new instance with the same settings as this instance. ### Default Creates default options for tool generation. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions Default() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions` A new instance with default settings. ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### FormatToolName Formats a tool name with the configured prefix and suffix. #### Syntax ```csharp theme={"dark"} public string FormatToolName(string baseName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `baseName` | `string` | The base name of the tool. | #### Returns Type: `string` The formatted tool name. ### GetCombinedScopes Gets the required scopes for a specific entity type and operation combination. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetCombinedScopes(string entityTypeName, Microsoft.OData.Mcp.Core.Tools.McpToolOperationType operationType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The entity type name. | | `operationType` | `Microsoft.OData.Mcp.Core.Tools.McpToolOperationType` | The operation type. | #### Returns Type: `System.Collections.Generic.IEnumerable` The combined required scopes. ### GetEntityScopes Gets the required scopes for the specified entity type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetEntityScopes(string entityTypeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The entity type name. | #### Returns Type: `System.Collections.Generic.IEnumerable` The required scopes for the entity type. ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetOperationScopes Gets the required scopes for the specified operation type. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable GetOperationScopes(Microsoft.OData.Mcp.Core.Tools.McpToolOperationType operationType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operationType` | `Microsoft.OData.Mcp.Core.Tools.McpToolOperationType` | The operation type. | #### Returns Type: `System.Collections.Generic.IEnumerable` The required scopes for the operation type. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### Performance Creates options optimized for performance. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions Performance() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions` A new instance with performance-optimized settings. ### ReadOnly Creates options for read-only access. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions ReadOnly() ``` #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions` A new instance configured for read-only operations. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ShouldIncludeEntityType Determines whether the specified entity type should be included. #### Syntax ```csharp theme={"dark"} public bool ShouldIncludeEntityType(string entityTypeName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entityTypeName` | `string` | The entity type name to check. | #### Returns Type: `bool` `true` if the entity type should be included; otherwise, `false`. ### ShouldIncludeOperation Determines whether the specified operation should be included. #### Syntax ```csharp theme={"dark"} public bool ShouldIncludeOperation(Microsoft.OData.Mcp.Core.Tools.McpToolOperationType operationType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operationType` | `Microsoft.OData.Mcp.Core.Tools.McpToolOperationType` | The operation type to check. | #### Returns Type: `bool` `true` if the operation should be included; otherwise, `false`. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Validate Validates the options for consistency and completeness. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable Validate() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of validation errors, or empty if the options are valid. # McpToolOperationType Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolOperationType Defines the operation types for MCP tools. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolOperationType ``` ## Summary Defines the operation types for MCP tools. ## Values | Name | Value | Description | | - | - | - | | `Read` | 0 | Read operation that retrieves data without modification. | | `Create` | 1 | Create operation that adds new data. | | `Update` | 2 | Update operation that modifies existing data. | | `Delete` | 3 | Delete operation that removes data. | | `Query` | 4 | Query operation that searches and filters data. | | `Navigate` | 5 | Navigate operation that traverses relationships. | | `Batch` | 6 | Batch operation that processes multiple items. | | `Custom` | 7 | Custom operation with specific business logic. | # McpToolResult Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolResult Represents the result of an MCP tool execution. ## Definition **Assembly:** Microsoft.OData.Mcp.Core.dll **Namespace:** Microsoft.OData.Mcp.Core.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Core.Tools.McpToolResult ``` ## Summary Represents the result of an MCP tool execution. ## Remarks This class standardizes the format of tool execution results, providing consistent error handling, data formatting, and metadata across all tools. ## Constructors ### .ctor Initializes a new instance of the [McpToolResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolResult) class. #### Syntax ```csharp theme={"dark"} public McpToolResult() ``` ### .ctor Initializes a new instance of the [McpToolResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolResult) class with success status. #### Syntax ```csharp theme={"dark"} public McpToolResult(System.Text.Json.JsonDocument data, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `System.Text.Json.JsonDocument?` | The result data. | | `correlationId` | `string?` | The correlation ID. | ### .ctor Initializes a new instance of the [McpToolResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolResult) class with error status. #### Syntax ```csharp theme={"dark"} public McpToolResult(string errorMessage, string errorCode = null, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `errorMessage` | `string` | The error message. | | `errorCode` | `string?` | The error code. | | `correlationId` | `string?` | The correlation ID. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CompletedAt Gets or sets the timestamp when the execution completed. #### Syntax ```csharp theme={"dark"} public System.DateTime CompletedAt { get; set; } ``` #### Property Value Type: `System.DateTime?` The UTC timestamp when the tool finished executing. #### Remarks This timestamp can be used for auditing and troubleshooting purposes. ### CorrelationId Gets or sets the correlation ID for this execution. #### Syntax ```csharp theme={"dark"} public string CorrelationId { get; set; } ``` #### Property Value Type: `string?` The correlation ID that can be used to trace this execution across systems. #### Remarks This should match the correlation ID from the tool context for end-to-end tracing. ### Data Gets or sets the result data as a JSON document. #### Syntax ```csharp theme={"dark"} public System.Text.Json.JsonDocument Data { get; set; } ``` #### Property Value Type: `System.Text.Json.JsonDocument?` The structured result data, or null if no data is available. #### Remarks The data format depends on the specific tool but should always be valid JSON that can be consumed by MCP clients. ### ErrorCode Gets or sets the error code for failed executions. #### Syntax ```csharp theme={"dark"} public string ErrorCode { get; set; } ``` #### Property Value Type: `string?` A machine-readable error code, or null if execution was successful. #### Remarks Error codes provide a standardized way for clients to handle specific error conditions programmatically. ### ErrorMessage Gets or sets the error message for failed executions. #### Syntax ```csharp theme={"dark"} public string ErrorMessage { get; set; } ``` #### Property Value Type: `string?` A human-readable error message, or null if execution was successful. #### Remarks Error messages should be clear and actionable, helping users understand what went wrong and how to fix it. ### ExecutionDuration Gets or sets the execution duration. #### Syntax ```csharp theme={"dark"} public System.TimeSpan ExecutionDuration { get; set; } ``` #### Property Value Type: `System.TimeSpan?` The time taken to execute the tool. #### Remarks This information is useful for performance monitoring and optimization. ### IsSuccess Gets or sets a value indicating whether the tool execution was successful. #### Syntax ```csharp theme={"dark"} public bool IsSuccess { get; set; } ``` #### Property Value Type: `bool` `true` if the execution was successful; otherwise, `false`. #### Remarks Success indicates that the tool executed without errors and completed its intended operation, regardless of whether data was found or modified. ### Metadata Gets or sets additional metadata about the execution. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Generic.Dictionary` A dictionary of metadata key-value pairs. #### Remarks Metadata can include information such as execution time, record counts, caching status, or other operational details. ### StatusCode Gets or sets the HTTP status code equivalent for this result. #### Syntax ```csharp theme={"dark"} public int StatusCode { get; set; } ``` #### Property Value Type: `int` The HTTP status code that best represents this result. #### Remarks This helps clients understand the result in terms of standard HTTP semantics, even when the tool isn't directly related to HTTP operations. ### Warnings Gets or sets warnings that occurred during execution. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.List Warnings { get; set; } ``` #### Property Value Type: `System.Collections.Generic.List` A collection of warning messages. #### Remarks Warnings indicate potential issues or notable conditions that didn't prevent successful execution but may be of interest to users. ## Methods ### AddMetadata Adds metadata to the result. #### Syntax ```csharp theme={"dark"} public void AddMetadata(string key, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | | `value` | `object` | The metadata value. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *key* is null or whitespace. | ### AddWarning Adds a warning to the result. #### Syntax ```csharp theme={"dark"} public void AddWarning(string warning) ``` #### Parameters | Name | Type | Description | | - | - | - | | `warning` | `string` | The warning message. | #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *warning* is null or whitespace. | ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Error Creates an error result with the specified message and code. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolResult Error(string errorMessage, string errorCode = null, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `errorMessage` | `string` | The error message. | | `errorCode` | `string?` | The error code. | | `correlationId` | `string?` | The correlation ID. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolResult` An error MCP tool result. #### Exceptions | Exception | Description | | - | - | | `ArgumentException` | Thrown when *errorMessage* is null or whitespace. | ### Error Creates an error result from an exception. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolResult Error(System.Exception exception, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `exception` | `System.Exception` | The exception that occurred. | | `correlationId` | `string?` | The correlation ID. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolResult` An error MCP tool result. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *exception* is null. | ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMetadata Gets metadata value by key. #### Syntax ```csharp theme={"dark"} public T GetMetadata(string key) ``` #### Parameters | Name | Type | Description | | - | - | - | | `key` | `string` | The metadata key. | #### Returns Type: `T?` The metadata value if found and of the correct type; otherwise, the default value. #### Type Parameters * `T` - The type of the metadata value. ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### NotFound Creates a not found result. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolResult NotFound(string message = null, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string?` | The not found message. | | `correlationId` | `string?` | The correlation ID. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolResult` A not found MCP tool result. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetExecutionDuration Sets the execution duration based on a start time. #### Syntax ```csharp theme={"dark"} public void SetExecutionDuration(System.DateTime startTime) ``` #### Parameters | Name | Type | Description | | - | - | - | | `startTime` | `System.DateTime?` | The execution start time. | ### Success Creates a successful result with the specified data. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolResult Success(System.Text.Json.JsonDocument data = null, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `System.Text.Json.JsonDocument?` | The result data. | | `correlationId` | `string?` | The correlation ID. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolResult` A successful MCP tool result. ### Success Creates a successful result with the specified object data. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolResult Success(object data, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `data` | `object` | The data object to serialize to JSON. | | `correlationId` | `string?` | The correlation ID. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolResult` A successful MCP tool result. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *data* is null. | ### ToDictionary Converts the result to a dictionary for JSON serialization. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.Dictionary ToDictionary() ``` #### Returns Type: `System.Collections.Generic.Dictionary` A dictionary representation of the result. ### ToString Returns a JSON string representation of the result. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` A JSON string representation of the result. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### Unauthorized Creates an unauthorized result. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolResult Unauthorized(string message = null, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string?` | The unauthorized message. | | `correlationId` | `string?` | The correlation ID. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolResult` An unauthorized MCP tool result. ### ValidationError Creates a validation error result. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Mcp.Core.Tools.McpToolResult ValidationError(string message, string correlationId = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | The validation error message. | | `correlationId` | `string?` | The correlation ID. | #### Returns Type: `Microsoft.OData.Mcp.Core.Tools.McpToolResult` A validation error MCP tool result. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/index Summary of the Microsoft.OData.Mcp.Core.Tools Namespace ## Types ### Classes | Name | Summary | | - | - | | [McpToolContext](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolContext) | Provides execution context for MCP tool operations. | | [McpToolDefinition](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolDefinition) | Represents a complete MCP tool definition with metadata and implementation details. | | [McpToolExample](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolExample) | Represents an example usage pattern for an MCP tool. | | [McpToolExampleDifficulty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolExampleDifficulty) | Defines the difficulty levels for MCP tool examples. | | [McpToolFactory](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolFactory) | Factory for creating MCP tools dynamically from OData metadata. | | [McpToolGenerationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolGenerationOptions) | Configuration options for MCP tool generation. | | [McpToolOperationType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolOperationType) | Defines the operation types for MCP tools. | | [McpToolResult](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolResult) | Represents the result of an MCP tool execution. | ### Interfaces | Name | Summary | | - | - | | [IMcpToolFactory](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/IMcpToolFactory) | Factory for creating MCP tools dynamically from OData metadata. | ### Enums | Name | Summary | | - | - | | [McpToolExampleDifficulty](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolExampleDifficulty) | Defines the difficulty levels for MCP tool examples. | | [McpToolOperationType](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Tools/McpToolOperationType) | Defines the operation types for MCP tools. | # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/index Summary of the Microsoft.OData.Mcp.Core Namespace ## Types ### Classes | Name | Summary | | - | - | | [ODataMcpOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/ODataMcpOptions) | Configuration options for OData MCP integration. | # AddCommand Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/AddCommand Interactive wizard command to generate Claude Code MCP registration commands. ## Definition **Assembly:** Microsoft.OData.Mcp.Tools.dll **Namespace:** Microsoft.OData.Mcp.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Tools.Commands.AddCommand ``` ## Summary Interactive wizard command to generate Claude Code MCP registration commands. ## Remarks This command provides an interactive experience for users to configure their OData service connection and generates the appropriate /mcp add command for Claude Code. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public AddCommand() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the interactive wizard for generating MCP registration commands. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code (0 for success). ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ODataMcpRootCommand Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/ODataMcpRootCommand Root command for the OData MCP CLI tool. ## Definition **Assembly:** Microsoft.OData.Mcp.Tools.dll **Namespace:** Microsoft.OData.Mcp.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Tools.Commands.ODataMcpRootCommand ``` ## Summary Root command for the OData MCP CLI tool. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ODataMcpRootCommand() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecute Executes when the root command is invoked without subcommands. #### Syntax ```csharp theme={"dark"} public int OnExecute(McMaster.Extensions.CommandLineUtils.CommandLineApplication app) ``` #### Parameters | Name | Type | Description | | - | - | - | | `app` | `McMaster.Extensions.CommandLineUtils.CommandLineApplication` | The command line application instance. | #### Returns Type: `int` Exit code 0 for success. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # StartCommand Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/StartCommand Command to start the OData MCP server. ## Definition **Assembly:** Microsoft.OData.Mcp.Tools.dll **Namespace:** Microsoft.OData.Mcp.Tools.Commands **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Tools.Commands.StartCommand ``` ## Summary Command to start the OData MCP server. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public StartCommand() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthToken Gets or sets the authentication token. #### Syntax ```csharp theme={"dark"} public string AuthToken { get; set; } ``` #### Property Value Type: `string?` ### Url Gets or sets the OData service URL. #### Syntax ```csharp theme={"dark"} public string Url { get; set; } ``` #### Property Value Type: `string?` ### Verbose Gets or sets whether to enable verbose logging. #### Syntax ```csharp theme={"dark"} public bool Verbose { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnExecuteAsync Executes the start command. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnExecuteAsync() ``` #### Returns Type: `System.Threading.Tasks.Task` Exit code. ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/index Summary of the Microsoft.OData.Mcp.Tools.Commands Namespace ## Types ### Classes | Name | Summary | | - | - | | [AddCommand](/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/AddCommand) | Interactive wizard command to generate Claude Code MCP registration commands. | | [ODataMcpRootCommand](/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/ODataMcpRootCommand) | Root command for the OData MCP CLI tool. | | [StartCommand](/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/StartCommand) | Command to start the OData MCP server. | # Program Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Program Main entry point for the OData MCP Tools CLI. ## Definition **Assembly:** Microsoft.OData.Mcp.Tools.dll **Namespace:** Microsoft.OData.Mcp.Tools **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Tools.Program ``` ## Summary Main entry point for the OData MCP Tools CLI. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public Program() ``` ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### Main Main entry point. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task Main(string[] args) ``` #### Parameters | Name | Type | Description | | - | - | - | | `args` | `string[]` | Command line arguments. | #### Returns Type: `System.Threading.Tasks.Task` Exit code. ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DynamicToolGeneratorService Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Services/DynamicToolGeneratorService Background service that generates dynamic MCP tools based on OData metadata. ## Definition **Assembly:** Microsoft.OData.Mcp.Tools.dll **Namespace:** Microsoft.OData.Mcp.Tools.Services **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.OData.Mcp.Tools.Services.DynamicToolGeneratorService ``` ## Summary Background service that generates dynamic MCP tools based on OData metadata. ## Constructors ### .ctor Initializes a new instance of the [DynamicToolGeneratorService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Services/DynamicToolGeneratorService) class. #### Syntax ```csharp theme={"dark"} public DynamicToolGeneratorService(Microsoft.Extensions.Logging.ILogger logger, Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory toolFactory, Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser metadataParser, Microsoft.Extensions.Options.IOptions configuration, Microsoft.OData.Mcp.Core.Server.DynamicODataMcpTools dynamicTools, System.IServiceProvider serviceProvider) ``` #### Parameters | Name | Type | Description | | - | - | - | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger. | | `toolFactory` | `Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory` | The tool factory for generating dynamic tools. | | `metadataParser` | `Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser` | The CSDL metadata parser. | | `configuration` | `Microsoft.Extensions.Options.IOptions` | The server configuration. | | `dynamicTools` | `Microsoft.OData.Mcp.Core.Server.DynamicODataMcpTools` | The dynamic OData tools instance. | | `serviceProvider` | `System.IServiceProvider` | The service provider for DI. | ### .ctor Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### StartAsync Starts the service and generates dynamic tools. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `cancellationToken` | `System.Threading.CancellationToken` | The cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### StopAsync Stops the service. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `cancellationToken` | `System.Threading.CancellationToken` | The cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task representing the asynchronous operation. ### ToString Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Extensions.Hosting.IHostedService # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Services/index Summary of the Microsoft.OData.Mcp.Tools.Services Namespace ## Types ### Classes | Name | Summary | | - | - | | [DynamicToolGeneratorService](/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Services/DynamicToolGeneratorService) | Background service that generates dynamic MCP tools based on OData metadata. | # Overview Source: https://easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/index Summary of the Microsoft.OData.Mcp.Tools Namespace ## Types ### Classes | Name | Summary | | - | - | | [Program](/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Program) | Main entry point for the OData MCP Tools CLI. | # ClaimsPrincipal Source: https://easyaf.dev/odata-mcp/api-reference/System/Security/Claims/ClaimsPrincipal Extension methods for ClaimsPrincipal from System.Security.Claims ## Definition **Assembly:** System.Security.Claims.dll **Namespace:** System.Security.Claims ## Syntax ```csharp theme={"dark"} System.Security.Claims.ClaimsPrincipal ``` ## Summary This type is defined in System.Security.Claims. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal) for more information about the rest of the API. ## Methods ### GetUserEmail Extension method from `System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions` Gets the user email from the claims principal. #### Syntax ```csharp theme={"dark"} public static string GetUserEmail(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to extract the email from. | #### Returns Type: `string?` The user email, or null if not found. #### Remarks This method looks for the email in common claim types used by different authentication providers. ### GetUserId Extension method from `System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions` Gets the user identifier from the claims principal. #### Syntax ```csharp theme={"dark"} public static string GetUserId(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to extract the user ID from. | #### Returns Type: `string?` The user identifier, or null if not found. #### Remarks This method looks for the user identifier in common claim types used by different authentication providers. ### GetUserName Extension method from `System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions` Gets the username from the claims principal. #### Syntax ```csharp theme={"dark"} public static string GetUserName(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to extract the username from. | #### Returns Type: `string?` The username, or null if not found. #### Remarks This method looks for the username in common claim types used by different authentication providers. ### GetUserRoles Extension method from `System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions` Gets the user roles from the claims principal. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable GetUserRoles(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to extract roles from. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of user roles, or empty if no roles are found. #### Examples ```csharp theme={"dark"} var userRoles = User.GetUserRoles(); if (userRoles.Contains("Administrator")) { // User has administrator role } ``` #### Remarks This method looks for roles in various claim types commonly used by different authentication providers. Roles can be in individual claims or comma-separated values. ### GetUserScopes Extension method from `System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions` Gets the user scopes from the claims principal. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable GetUserScopes(System.Security.Claims.ClaimsPrincipal principal) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to extract scopes from. | #### Returns Type: `System.Collections.Generic.IEnumerable` A collection of user scopes, or empty if no scopes are found. #### Examples ```csharp theme={"dark"} var userScopes = User.GetUserScopes(); if (userScopes.Contains("read:users")) { // User has permission to read users } ``` #### Remarks This method looks for scopes in various claim types commonly used by different authentication providers. Scopes are typically space-separated values in a single claim. ### HasRole Extension method from `System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions` Determines whether the user has the specified role. #### Syntax ```csharp theme={"dark"} public static bool HasRole(System.Security.Claims.ClaimsPrincipal principal, string role) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to check. | | `role` | `string` | The role to check for. | #### Returns Type: `bool` `true` if the user has the specified role; otherwise, `false`. ### HasScope Extension method from `System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions` Determines whether the user has the specified scope. #### Syntax ```csharp theme={"dark"} public static bool HasScope(System.Security.Claims.ClaimsPrincipal principal, string scope) ``` #### Parameters | Name | Type | Description | | - | - | - | | `principal` | `System.Security.Claims.ClaimsPrincipal` | The claims principal to check. | | `scope` | `string` | The scope to check for. | #### Returns Type: `bool` `true` if the user has the specified scope; otherwise, `false`. # McpAuthentication_ClaimsPrincipalExtensions Source: https://easyaf.dev/odata-mcp/api-reference/System/Security/Claims/McpAuthentication_ClaimsPrincipalExtensions Extension methods for [ClaimsPrincipal](/odata-mcp/api-reference/System/Security/Claims/ClaimsPrincipal) to extract user information. ## Definition **Assembly:** Microsoft.OData.Mcp.Authentication.dll **Namespace:** System.Security.Claims **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} System.Security.Claims.McpAuthentication_ClaimsPrincipalExtensions ``` ## Summary Extension methods for [ClaimsPrincipal](/odata-mcp/api-reference/System/Security/Claims/ClaimsPrincipal) to extract user information. ## Remarks These extensions provide convenient methods to extract user scopes, roles, and other information from JWT tokens and other authentication schemes. # Overview Source: https://easyaf.dev/odata-mcp/api-reference/System/Security/Claims/index Summary of the System.Security.Claims Namespace ## Types ### Classes | Name | Summary | | - | - | | [McpAuthentication\_ClaimsPrincipalExtensions](/odata-mcp/api-reference/System/Security/Claims/McpAuthentication_ClaimsPrincipalExtensions) | Extension methods for [ClaimsPrincipal](/odata-mcp/api-reference/System/Security/Claims/ClaimsPrincipal) to extract user information. | # Odata mcp Source: https://easyaf.dev/odata-mcp/index # Better .NET Applications with EasyAF Source: https://easyaf.dev/quickstart Get up and running quickly is as easy as 1-2-3. ### Install the EasyAF CLI ```bash Major Releases theme={"dark"} dotnet tool install EasyAF --global ``` ```bash Previews theme={"dark"} dotnet tool install EasyAF --global --prerelease ``` ### Add EasyAF to your Solution Navigate to your solution folder and create a new documentation project: ```bash theme={"dark"} dotnet docs add ``` By default, this creates a Mintlify documentation project using the latest stable SDK version from NuGet. To use a different documentation type or prerelease SDK: ```bash theme={"dark"} # Use a different documentation type dotnet docs add --type DocFX # Use the latest prerelease SDK version dotnet docs add --prerelease ``` The CLI automatically queries NuGet.org for the latest SDK version. See more options in the [CLI Reference](/guides/cli-reference) docs. This automatically: * locates the solution * creates a new `{SolutionName}.Docs\{SolutionName}.Docs.docsproj` file that centralizes your documentation * adds the new project to your solution The new project is pre-configured with sensible defaults. For Mintlify projects, it looks like this: ```xml theme={"dark"} Mintlify true Folder true false false Unified {solutionName} maple #419AC5 #419AC5 #3CD0E2 ``` ```xml theme={"dark"} Mintlify true Folder true false false Unified {solutionName} maple #419AC5 #419AC5 #3CD0E2 ``` ```xml theme={"dark"} DocFX true Folder true false false ``` ```xml theme={"dark"} DocFX true Folder true false false ``` ```xml theme={"dark"} MkDocs true Folder true false false ``` ```xml theme={"dark"} MkDocs true Folder true false false ``` ```xml theme={"dark"} Jekyll true Folder true false false ``` ```xml theme={"dark"} Jekyll true Folder true false false ``` ```xml theme={"dark"} Hugo true Folder true false false ``` ```xml theme={"dark"} Hugo true Folder true false false ``` ```xml theme={"dark"} Generic true Folder true false false ``` ```xml theme={"dark"} Generic true Folder true false false ``` You can see more of how to configure your .docsproj file in the [.docsproj Reference](/guides/docsproj) docs. Now your documentation lives right next to your code - no more context switching! Edit your doc files in Visual Studio with full IntelliSense support. Your documentation project is now part of your solution and will stay in sync with your codebase. ### Adjust your .docsproj settings Change the documentation type, shut off API Reference generation, turn off conceptual docs, and adjust any other settings as necessary. ### Enable XML Documentation Comment compilation Add this to the projects where you want to extract the XML Documentation comments from your code: ```xml theme={"dark"} true bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml ``` ### Exclude unnecessary projects Test projects are excluded by default. If there are other projects you'd like to exclude, update your `.docsproj` with the following property: ```xml theme={"dark"} pattern1;pattern2 ``` ### Generate API Documentation Run the documentation generator: ```bash theme={"dark"} dotnet build ``` EasyAF will: * Parse your assembly XML documentation * Extract all public types, methods, properties, and events * Combine it with any conceptual docs you've written * Render files in the format of your choice in the folder you specified Your API documentation now stays in sync with every build - no more stale docs! ### Local Development with Mintlify Preview your docs locally with Mintlify's dev server: ```bash theme={"dark"} npm i mint -g cd {SolutionName}.Docs mint dev ``` Open [http://localhost:3000](http://localhost:3000) to see your docs with hot-reload. ### Deploy to Mintlify Connect your GitHub repository to Mintlify for automatic deployments: 1. Push your docs to GitHub 2. Go to [mintlify.com](https://mintlify.com) and connect your repo 3. Mintlify automatically deploys on every push to main ### Deploy to GitHub Pages Add a GitHub Actions workflow (`.github/workflows/docs.yml`): ```yaml theme={"dark"} name: Deploy Docs on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-dotnet@v3 with: dotnet-version: '9.0' - name: Generate Docs run: | dotnet tool restore dotnet docs generate - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./MyProject.Docs ``` ### CI/CD Integration EasyAF integrates with your existing build pipeline: ```bash theme={"dark"} # In your CI/CD pipeline dotnet restore dotnet build --configuration Release ``` Your documentation is now deployed and accessible to your users! # Release Notes Source: https://easyaf.dev/release-notes What changed in each EasyAF release, including breaking changes and how to upgrade. # EasyAF 5.0 ## Performance Improvements EasyAF 5.0 removes reflection and expression trees from the code your app runs on every request, every save, and every property assignment. `EntityManager` checks an entity's audit interfaces with pattern matching instead of a type dictionary and LINQ: 40.05 ns → 0.58 ns. Generated setters use `nameof` instead of building an expression tree on every assignment: 874.4 ns → 28.6 ns, and zero allocations. Deserializing runs every property's setter, so the faster setters and the new serializer contract combine: 1,696.7 ns → 284.6 ns, 90.8% fewer allocations. | Area | Speed | Memory | | - | - | - | | Detecting audit interfaces in `EntityManager` | **68.7x faster** | No allocations before or after | | Setting properties on generated entities | **30.6x faster** | **100% fewer allocations** | | Serializing entities without audit fields | **13.9x faster** | **92.1% fewer allocations** | | `EntityManager` lifecycle methods | **6.5x to 10.5x faster** | **92.4% to 98.0% fewer allocations** | | Deserializing entities | **6.0x faster** | **90.8% fewer allocations** | | Reading the user's ID from `ClaimsPrincipal` | **4.1x faster** | **97.7% fewer allocations** | | Creating a generated entity | **2.0x faster** | **32.3% fewer allocations** | | **Creating and saving an entity, end to end (EF Core)** | **6.0% faster** | **7.0% fewer allocations** | | **Creating and saving an entity, end to end (EF6)** | No measurable change | **1.5% fewer allocations** | "Faster" is before ÷ after. "Fewer allocations" is (before − after) ÷ before. Every "before" is the EasyAF 4.x code, frozen in a `V4` namespace in the benchmark projects so both versions run side by side. ### Creating and saving an entity, end to end This is what your app does when it creates a record: create an entity, set its properties, and save it through the generated manager. Each save uses a new context and manager, the way a scoped request does, and writes to an in-memory database so disk and network time don't hide the difference. | | EasyAF 4.x | EasyAF 5.0 | Improvement | | - | - | - | - | | EF Core, time per save | 17.75 µs | 16.68 µs | **6.0% faster** (1.07 µs saved) | | EF Core, memory per save | 31.7 KB | 29.5 KB | **7.0% fewer allocations** | | EF6, time per save | 3.041 ms | 3.056 ms | No measurable change | | EF6, memory per save | 503.7 KB | 496.3 KB | **1.5% fewer allocations** | The individual improvements below are large, but Entity Framework does most of the work in a save. EasyAF 5.0 saves about 1 µs and 2 to 7 KB of allocations per save. On EF Core, that's 6% of the whole save. EF6 spends about 3 ms per save, so the time saved is smaller than the run-to-run variation. With a real database, network time makes the share smaller again, but the allocations you save still reduce garbage collection on a busy server. ### Audit interface detection in `EntityManager` `EntityManager` checked which audit interfaces an entity implements by caching each type's interfaces in a type dictionary, then searching them with LINQ. It now uses pattern matching (`entity is ICreatedAuditable`), which compiles to a single type check and works with Native AOT. Checking all four audit interfaces on a `Product`, as `ResetAuditProperties` does: | | Time | Memory | | - | - | - | | EasyAF 4.x (type dictionary + LINQ) | 40.05 ns | 0 B | | EasyAF 5.0 (pattern matching) | 0.58 ns | 0 B | | **Improvement** | **68.7x faster** (40.05 ÷ 0.583) | No change | ### `EntityManager` lifecycle methods These run inside every insert, update, and reset. They combine the faster interface checks, the faster ID claim lookup, and the faster setters. Both flavors run the same scenario, with the database query skipped so only EasyAF's code is measured. | Method | Flavor | EasyAF 4.x | EasyAF 5.0 | Speed | Memory | | - | - | - | - | - | - | | `OnInsertingAsync` | EF6 | 1,016.8 ns, 2,744 B | 125.8 ns, 208 B | **8.1x faster** | **92.4% fewer** | | `OnInsertingAsync` | EF Core | 1,087.7 ns, 2,824 B | 119.2 ns, 208 B | **9.1x faster** | **92.6% fewer** | | `OnUpdatingAsync` | EF6 | 451.8 ns, 1,440 B | 62.1 ns, 40 B | **7.3x faster** | **97.2% fewer** | | `OnUpdatingAsync` | EF Core | 402.9 ns, 1,360 B | 61.6 ns, 40 B | **6.5x faster** | **97.1% fewer** | | `ResetAuditProperties` | EF6 | 674.5 ns, 1,968 B | 64.5 ns, 40 B | **10.5x faster** | **98.0% fewer** | | `ResetAuditProperties` | EF Core | 698.3 ns, 1,968 B | 70.0 ns, 40 B | **10.0x faster** | **98.0% fewer** | ### Generated property setters Generated setters now call `Set(nameof(Name), ref _name, value)` instead of `Set(() => Name, ref _name, value)`. The old form built an expression tree on every assignment. `nameof` is a compile-time constant, so an assignment no longer allocates at all. Rebuild your project to regenerate your entities. Setting 7 properties on a generated `Product`: | | Time | Memory | | - | - | - | | EasyAF 4.x | 874.4 ns | 2,128 B | | EasyAF 5.0 | 28.6 ns | 0 B | | **Improvement** | **30.6x faster** (874.4 ÷ 28.55) | **100% fewer** (2,128 B → 0 B) | With a `PropertyChanged` subscriber, such as a Blazor binding, each change also allocates a 24 B `PropertyChangedEventArgs`: | | Time | Memory | | - | - | - | | EasyAF 4.x | 905.1 ns | 2,296 B | | EasyAF 5.0 | 40.1 ns | 168 B | | **Improvement** | **22.6x faster** (905.1 ÷ 40.09) | **92.7% fewer** (2,296 B → 168 B) | ### Serializing and deserializing entities `IgnoreAuditFields()` removes the audit properties from System.Text.Json's contract once per type, instead of using reflection on every call. The obsolete `IgnoreAuditFieldsJsonConverterFactory` now uses the same approach, so apps that haven't migrated get almost the same gain. Serializing one `Product`: | | Time | Memory | | - | - | - | | EasyAF 4.x converter | 1,545.0 ns | 5,240 B | | EasyAF 5.0 `IgnoreAuditFields()` | 111.2 ns | 416 B | | **Improvement** | **13.9x faster** (1,545.0 ÷ 111.2) | **92.1% fewer** (5,240 B → 416 B) | | EasyAF 5.0 obsolete converter | 117.2 ns | 416 B | Deserializing one `Product`, which also runs every property's setter: | | Time | Memory | | - | - | - | | EasyAF 4.x converter and entity | 1,696.7 ns | 2,432 B | | EasyAF 5.0 `IgnoreAuditFields()` and entity | 284.6 ns | 224 B | | **Improvement** | **6.0x faster** (1,696.7 ÷ 284.6) | **90.8% fewer** (2,432 B → 224 B) | Serializing with `IgnoreAuditFields()` is now faster than serializing the whole entity with plain System.Text.Json (186.8 ns, 696 B), because it writes four fewer properties. ### Reading the user's ID claim `ClaimsPrincipal.GetIdClaim()` rebuilt the claim type string for every claim it checked, and allocated a closure, on every call. The claim type is now cached, and only rebuilt when you change the claim configuration. | | Time | Memory | | - | - | - | | EasyAF 4.x | 155.9 ns | 1,704 B | | EasyAF 5.0 | 38.0 ns | 40 B | | **Improvement** | **4.1x faster** (155.9 ÷ 38.0) | **97.7% fewer** (1,704 B → 40 B) | ### Creating entities `DbObservableObject` created an empty `OriginalValues` dictionary in every constructor, even though most entities are never change-tracked. The dictionary is now created on the first tracked change. Entity Framework constructs an entity for every row it reads, so this adds up on large queries. | | Time | Memory | | - | - | - | | EasyAF 4.x | 10.1 ns | 248 B | | EasyAF 5.0 | 5.2 ns | 168 B | | **Improvement** | **2.0x faster** (10.11 ÷ 5.15) | **32.3% fewer** (248 B → 168 B) | Measured with BenchmarkDotNet 0.15.8 and its default job, on .NET 10.0.12, on an Intel Core Ultra 9 285K running Windows 11. The end-to-end benchmarks use Effort for EF6 and the EF Core InMemory provider. The benchmarks, and the EasyAF 4.x code they compare against, are in the `CloudNimble.EasyAF.Benchmarks.Core`, `.EF6`, and `.EFCore` projects. Run one with `dotnet run -c Release -f net10.0 --project src/CloudNimble.EasyAF.Benchmarks.Core`. Times vary by machine; the ratios are what matter. ## Breaking changes ### .NET 8 and .NET 9 are no longer supported EasyAF 5.0 targets .NET 10 and .NET 11. Packages that also target `netstandard2.0`, `net48`, or `net472` still do. Move your projects to .NET 10 or later before upgrading. ### `IgnoreAuditFieldsJsonConverterFactory` is obsolete, and its output changed Call `IgnoreAuditFields()` on your `JsonSerializerOptions` instead: ```csharp theme={"dark"} var options = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, Converters = { new JsonStringEnumConverter() }, }.IgnoreAuditFields(); ``` The obsolete converter still works, and both it and `IgnoreAuditFields()` now honor every System.Text.Json setting. That changes the JSON you send: * `WhenWritingDefault` now skips `0`, `false`, and `Guid.Empty`, not just `null`. Use `WhenWritingNull` to keep writing them. * Naming policies and `[JsonPropertyName]` now apply to entity properties. * Audit fields are also removed from related entities. See [IgnoreAuditFieldsJsonConverter](/api-reference/CloudNimble/EasyAF/Core/Converters/IgnoreAuditFieldsJsonConverter) for the full list and how to restore the 4.x output. ### `ICreatorTrackable` requires a non-nullable `CreatedById` Code generation only applies `ICreatorTrackable` when the `CreatedById` column is `NOT NULL`. If it allows nulls, the entity is still generated without the interface, and the build reports warning **EASYAF005** at the property in your EDMX. To keep creator tracking, make `CreatedById` required on every table, and assign built-in or seed data to a system user ID that has zero permissions. See [Table Design](/guides/table-design). ### Source generator diagnostic IDs `EASYAF001` was used for three different messages. Each now has its own ID: | ID | Severity | Meaning | | - | - | - | | `EASYAF001` | Warning | `EasyAFProjectType` is not set in the project file. | | `EASYAF006` | Info | Reports the `EasyAFProjectType` that was found. | | `EASYAF007` | Error | `EasyAFProjectType` is set to an unsupported value. | If you suppress `EASYAF001` in `NoWarn` or `.editorconfig`, check which of these messages you meant to suppress. ### `GenerateViews` is now `EasyAFGenerateViews` Rename the `GenerateViews` MSBuild property to `EasyAFGenerateViews`. The old name still works, but reports warning **EASYAF008**. If both are set, `GenerateViews` wins until you remove it. ### Restier `IModelBuilderExtensions` renamed The class is now `EasyAF_Restier_IModelBuilderExtensions`, to match the other EasyAF extension classes. Code that calls the methods as extensions is unaffected. Code that calls them through the class name must use the new name. ## Improvements * **`dotnet easyaf new`.** Creates a complete EasyAF solution in one command: Core, Data, Business, Api (with OData MCP), MessageBus, and Tests projects, referenced the way EasyAF expects, with `Directory.Build.props`, `global.json`, and an `.slnx`. Projects come from the .NET SDK's own templates, so they match your installed SDK. Use `--no-api`, `--no-messagebus`, or `--no-runtime` to leave projects out, `--webjob` to publish the message processor as an Azure WebJob, and `-f net11.0` to target .NET 11. Then run `dotnet easyaf init` to connect a database. * **`int` and `long` IDs for audit fields.** `EntityManager` now fills `CreatedById` and `UpdatedById` for `Guid`, `int`, and `long` IDs, from the user's ID claim. Use `ClaimsPrincipal.TryGetIdClaim(out int)` or `TryGetIdClaim(out long)` to read those IDs yourself. * **One less dependency.** `CloudNimble.EasyAF.Business` no longer depends on `Ben.TypeDictionary`. # DbContext Source: https://easyaf.dev/restier/api-reference/Microsoft/EntityFrameworkCore/DbContext Extension methods for DbContext from Microsoft.EntityFrameworkCore ## Definition **Assembly:** Microsoft.EntityFrameworkCore.dll **Namespace:** Microsoft.EntityFrameworkCore ## Syntax ```csharp theme={"dark"} Microsoft.EntityFrameworkCore.DbContext ``` ## Summary This type is defined in Microsoft.EntityFrameworkCore. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.dbcontext) for more information about the rest of the API. ## Methods ### IsDbSetMapped Extension Extension method from `Microsoft.Restier.EntityFrameworkCore.EFCoreDbContextExtensions` Does the specified entity type have a DbSet mapping in the model #### Syntax ```csharp theme={"dark"} public static bool IsDbSetMapped(Microsoft.EntityFrameworkCore.DbContext context, System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.EntityFrameworkCore.DbContext` | - | | `type` | `System.Type` | - | #### Returns Type: `bool` # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/EntityFrameworkCore/index Summary of the Microsoft.EntityFrameworkCore Namespace ## Types # IServiceCollection Source: https://easyaf.dev/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection Extension methods for IServiceCollection from Microsoft.Extensions.DependencyInjection.Abstractions ## Definition **Assembly:** Microsoft.Extensions.DependencyInjection.Abstractions.dll **Namespace:** Microsoft.Extensions.DependencyInjection ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.DependencyInjection.IServiceCollection ``` ## Summary This type is defined in Microsoft.Extensions.DependencyInjection.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection) for more information about the rest of the API. ## Methods ### AddChainedService Extension Extension method from `Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions` A Restier-specific method that adds a "service contributor", which has a chance to chain previously registered service instances. DO NOT use this method outside of a Restier app. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddChainedService(Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Func factory, Microsoft.Extensions.DependencyInjection.ServiceLifetime serviceLifetime = 0) where TService : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection) to register the *TService* with. | | `factory` | `System.Func` | A factory method to create a new instance of service TService, wrapping previous instance."/>. | | `serviceLifetime` | `Microsoft.Extensions.DependencyInjection.ServiceLifetime` | The [ServiceLifetime](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicelifetime) of the service being added. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` The *services* instance modified with the new *TService* reference. #### Type Parameters * `TService` - The service type to register with the [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). #### Remarks This process is being deprecated. Please DO NOT rely on it for future behavior in your own apps. V2 will properly handle multiple instances of a registration by firing them in succession. ### AddChainedService Extension Extension method from `Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions` A Restier-specific method that adds a "service contributor", which has a chance to chain previously registered service instances. DO NOT use this method outside of a Restier app. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddChainedService(Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.DependencyInjection.ServiceLifetime serviceLifetime = 0) where TService : class where TImplement : class, TService ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection) to register the *TService* with. | | `serviceLifetime` | `Microsoft.Extensions.DependencyInjection.ServiceLifetime` | The [ServiceLifetime](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicelifetime) of the service being added. | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` Current [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection) #### Type Parameters * `TService` - The service type to register with the [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). * `TImplement` - The implementation type. #### Remarks This process is being deprecated. Please DO NOT rely on it for future behavior in your own apps. V2 will properly handle multiple instances of a registration by firing them in succession. If want to cutoff previous registration, not define a property with type of TService or do not use it. The contributor added will get an instance of *TImplement* from the container, i.e. [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider), every time it's get called. This method will try to register *TImplement* as a service with [Transient](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicelifetime.transient) life time, if it's not yet registered. To override, you can register *TImplement* before or after calling this method. Note: When registering *TImplement*, you must NOT give it a [ServiceLifetime](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicelifetime) that makes it outlives *TService*, that could possibly make an instance of *TImplement* be used in multiple instantiations of *TService*, which leads to unpredictable behaviors. ### AddEF6ProviderServices Extension Extension method from `Microsoft.Extensions.DependencyInjection.RestierEntityFrameworkServiceCollectionExtensions` This method is used to add entity framework providers service into container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddEF6ProviderServices(Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TDbContext : System.Data.Entity.DbContext ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` Current [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). #### Type Parameters * `TDbContext` - The DbContext type. ### AddEFCoreProviderServices Extension Extension method from `Microsoft.Extensions.DependencyInjection.RestierEntityFrameworkServiceCollectionExtensions` This method is used to add entity framework providers service into container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddEFCoreProviderServices(Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action optionsAction = null) where TDbContext : Microsoft.EntityFrameworkCore.DbContext ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). | | `optionsAction` | `System.Action` | An optional action to configure the Microsoft.EntityFrameworkCore.DbContextOptions | | for the context. This provides an alternative to performing configuration of | | | | the context by overriding the Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder) | | | | method in your derived context. | | | | If an action is supplied here, the Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder) | | | | method will still be run if it has been overridden on the derived context. Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder) | | | | configuration will be applied in addition to configuration performed here. | | | | In order for the options to be passed into your context, you need to expose a | | | | constructor on your context that takes Microsoft.EntityFrameworkCore.DbContextOptions\`1 | | | | and passes it to the base constructor of Microsoft.EntityFrameworkCore.DbContext. | | | #### Returns Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection` Current [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). #### Type Parameters * `TDbContext` - The DbContext type. ### HasService Extension Extension method from `Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions` Return true if the [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection) has any *TService* service registered. #### Syntax ```csharp theme={"dark"} public static bool HasService(Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TService : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection) to register the *TService* with. | #### Returns Type: `bool` A [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not the *TService* #### Type Parameters * `TService` - The service type to register with the [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). ### HasServiceCount Extension Extension method from `Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions` Returns the number of services that match the given [ServiceType](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor.servicetype) in a given [ServiceCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicecollection). #### Syntax ```csharp theme={"dark"} public static int HasServiceCount(Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TService : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection) to register the *TService* with. | #### Returns Type: `int` An [Int32](https://learn.microsoft.com/dotnet/api/system.int32) representing the number of Services that match the given ServiceType. #### Type Parameters * `TService` - The service type to register with the [IServiceCollection](/restier/api-reference/Microsoft/Extensions/DependencyInjection/IServiceCollection). # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Extensions/DependencyInjection/index Summary of the Microsoft.Extensions.DependencyInjection Namespace ## Types # ApiBase Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ApiBase Represents a base class for an API. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ApiBase ``` ## Summary Represents a base class for an API. ## Remarks An API configuration is intended to be long-lived, and can be statically cached according to an API type specified when the configuration is created. Additionally, the API model produced as a result of a particular configuration is cached under the same API type to avoid re-computing it on each invocation. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ServiceProvider Gets the [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) which contains all services. #### Syntax ```csharp theme={"dark"} public System.IServiceProvider ServiceProvider { get; private set; } ``` #### Property Value Type: `System.IServiceProvider` ## Methods ### Dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetApiService Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Gets a service instance. #### Syntax ```csharp theme={"dark"} public static T GetApiService(Microsoft.Restier.Core.ApiBase api) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | #### Returns Type: `T` The service instance. #### Type Parameters * `T` - The service type. ### GetApiServices Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.IEnumerable GetApiServices(Microsoft.Restier.Core.ApiBase api) where T : class ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | - | #### Returns Type: `System.Collections.Generic.IEnumerable` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetModel Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Retrieves the [IEdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmmodel) used by this [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instance. #### Syntax ```csharp theme={"dark"} public static Microsoft.OData.Edm.IEdmModel GetModel(Microsoft.Restier.Core.ApiBase api) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | The [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instance to extend. | #### Returns Type: `Microsoft.OData.Edm.IEdmModel` The [IEdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmmodel) used by this [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instance. ### GetProperty Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Gets a property. #### Syntax ```csharp theme={"dark"} public static T GetProperty(Microsoft.Restier.Core.ApiBase api, string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `name` | `string` | The name of a property. | #### Returns Type: `T` The value of the property. #### Type Parameters * `T` - The type of the property. ### GetProperty Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Gets a property. #### Syntax ```csharp theme={"dark"} public static object GetProperty(Microsoft.Restier.Core.ApiBase api, string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `name` | `string` | The name of a property. | #### Returns Type: `object` The value of the property. ### GetQueryableSource Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Gets a queryable source of data using an API context. #### Syntax ```csharp theme={"dark"} public static System.Linq.IQueryable GetQueryableSource(Microsoft.Restier.Core.ApiBase api, string name, params object[] arguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `name` | `string` | The name of an entity set, singleton or composable function import. | | `arguments` | `object[]` | If *name* is a composable function import, | | the arguments to be passed to the composable function import. | | | #### Returns Type: `System.Linq.IQueryable` A queryable source. #### Remarks If the name identifies a singleton or a composable function import whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated as the API engine only operates asynchronously. ### GetQueryableSource Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Gets a queryable source of data using an API context. #### Syntax ```csharp theme={"dark"} public static System.Linq.IQueryable GetQueryableSource(Microsoft.Restier.Core.ApiBase api, string namespaceName, string name, params object[] arguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `namespaceName` | `string` | The name of a namespace containing a composable function. | | `name` | `string` | The name of a composable function. | | `arguments` | `object[]` | The arguments to be passed to the composable function. | #### Returns Type: `System.Linq.IQueryable` A queryable source. #### Remarks If the name identifies a composable function whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated, as the API engine only operates asynchronously. ### GetQueryableSource Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Gets a queryable source of data using an API context. #### Syntax ```csharp theme={"dark"} public static System.Linq.IQueryable GetQueryableSource(Microsoft.Restier.Core.ApiBase api, string name, params object[] arguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `name` | `string` | The name of an entity set, singleton or composable function import. | | `arguments` | `object[]` | If *name* is a composable function import, | | the arguments to be passed to the composable function import. | | | #### Returns Type: `System.Linq.IQueryable` A queryable source. #### Type Parameters * `TElement` - The type of the elements in the queryable source. #### Remarks If the name identifies a singleton or a composable function import whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated, as the API engine only operates asynchronously. ### GetQueryableSource Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Gets a queryable source of data using an API context. #### Syntax ```csharp theme={"dark"} public static System.Linq.IQueryable GetQueryableSource(Microsoft.Restier.Core.ApiBase api, string namespaceName, string name, params object[] arguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `namespaceName` | `string` | The name of a namespace containing a composable function. | | `name` | `string` | The name of a composable function. | | `arguments` | `object[]` | The arguments to be passed to the composable function. | #### Returns Type: `System.Linq.IQueryable` A queryable source. #### Type Parameters * `TElement` - The type of the elements in the queryable source. #### Remarks If the name identifies a composable function whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated, as the API engine only operates asynchronously. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasProperty Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Indicates if this object has a property. #### Syntax ```csharp theme={"dark"} public static bool HasProperty(Microsoft.Restier.Core.ApiBase api, string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `name` | `string` | The name of a property. | #### Returns Type: `bool` `true` if this object has the property; otherwise, `false`. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### QueryAsync Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Asynchronously queries for data using an API context. #### Syntax ```csharp theme={"dark"} public static System.Threading.Tasks.Task QueryAsync(Microsoft.Restier.Core.ApiBase api, Microsoft.Restier.Core.Query.QueryRequest request, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `request` | `Microsoft.Restier.Core.Query.QueryRequest` | A query request. | | `cancellationToken` | `System.Threading.CancellationToken` | An optional cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation whose result is a query result. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### RemoveProperty Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Removes a property. #### Syntax ```csharp theme={"dark"} public static void RemoveProperty(Microsoft.Restier.Core.ApiBase api, string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `name` | `string` | The name of a property. | ### SetProperty Extension Extension method from `Microsoft.Restier.Core.ApiBaseExtensions` Sets a property. #### Syntax ```csharp theme={"dark"} public static void SetProperty(Microsoft.Restier.Core.ApiBase api, string name, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An API. | | `name` | `string` | The name of a property. | | `value` | `object` | A value for the property. | ### SubmitAsync Asynchronously submits changes made using an API context. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task SubmitAsync(Microsoft.Restier.Core.Submit.ChangeSet changeSet = null, System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `changeSet` | `Microsoft.Restier.Core.Submit.ChangeSet` | A change set, or `null` to submit existing pending changes. | | `cancellationToken` | `System.Threading.CancellationToken` | An optional cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation whose result is a submit result. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * System.IDisposable # AuthorizationEntry Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry Describes the methods of verifying various CRUD operations for a given EF Entity. Useful in code generation scenarios ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Authorization **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Authorization.AuthorizationEntry ``` ## Summary Describes the methods of verifying various CRUD operations for a given EF Entity. Useful in code generation scenarios ## Constructors ### .ctor Creates a new instance of an [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry) for a given [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type). Assumes all authorization checks will return false by default. #### Syntax ```csharp theme={"dark"} public AuthorizationEntry(System.Type t) ``` #### Parameters | Name | Type | Description | | - | - | - | | `t` | `System.Type` | The [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) to track authorization methods for. | ### .ctor Creates a new instance of an [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry) for a given [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) while allowing you to specify the action to run when authorizing Inserts. #### Syntax ```csharp theme={"dark"} public AuthorizationEntry(System.Type t, System.Func canInsertAction) ``` #### Parameters | Name | Type | Description | | - | - | - | | `t` | `System.Type` | The [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) to track authorization methods for. | | `canInsertAction` | `System.Func` | A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be inserted through the Restier API. | ### .ctor Creates a new instance of an [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry) for a given [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) while allowing you to specify the actions to run when authorizing Inserts and Updates. #### Syntax ```csharp theme={"dark"} public AuthorizationEntry(System.Type t, System.Func canInsertAction, System.Func canUpdateAction) ``` #### Parameters | Name | Type | Description | | - | - | - | | `t` | `System.Type` | The [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) to track authorization methods for. | | `canInsertAction` | `System.Func` | A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be inserted through the Restier API. | | `canUpdateAction` | `System.Func` | A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be updated through the Restier API. | ### .ctor Creates a new instance of an [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry) for a given [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) while allowing you to specify the actions to run when authorizing Inserts, Updates, and Deletes. #### Syntax ```csharp theme={"dark"} public AuthorizationEntry(System.Type t, System.Func canInsertAction, System.Func canUpdateAction, System.Func canDeleteAction) ``` #### Parameters | Name | Type | Description | | - | - | - | | `t` | `System.Type` | The [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) to track authorization methods for. | | `canInsertAction` | `System.Func` | A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be inserted through the Restier API. | | `canUpdateAction` | `System.Func` | A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be updated through the Restier API. | | `canDeleteAction` | `System.Func` | A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be deleted through the Restier API. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CanDeleteAction A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be deleted through the Restier API. The default is false. #### Syntax ```csharp theme={"dark"} public System.Func CanDeleteAction { get; set; } ``` #### Property Value Type: `System.Func` ### CanInsertAction A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be inserted through the Restier API. The default is false. #### Syntax ```csharp theme={"dark"} public System.Func CanInsertAction { get; set; } ``` #### Property Value Type: `System.Func` ### CanUpdateAction A [Func\`1](https://learn.microsoft.com/dotnet/api/system.func-1) that evaluates to a [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not a record can be updated through the Restier API. The default is false. #### Syntax ```csharp theme={"dark"} public System.Func CanUpdateAction { get; set; } ``` #### Property Value Type: `System.Func` ### Type The [AuthorizationEntry.Type](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry#type) to register this [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry) for in the [AuthorizationFactory](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationFactory)AuthorizationFactory's\ backing Dictionary. #### Syntax ```csharp theme={"dark"} public System.Type Type { get; set; } ``` #### Property Value Type: `System.Type` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # AuthorizationFactory Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationFactory Maintains a Dictionary of [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry)AuthorizationEntries</see> for ea... ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Authorization **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Authorization.AuthorizationFactory ``` ## Summary Maintains a Dictionary of [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry)AuthorizationEntries\ for eacy access by Restier's Authorization framework. ## Methods ### ForType #### Syntax ```csharp theme={"dark"} public static Microsoft.Restier.Core.Authorization.AuthorizationEntry ForType() where T : class ``` #### Returns Type: `Microsoft.Restier.Core.Authorization.AuthorizationEntry` ### RegisterEntries #### Syntax ```csharp theme={"dark"} public static void RegisterEntries(System.Collections.Generic.List entries) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entries` | `System.Collections.Generic.List` | - | # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Authorization/index Summary of the Microsoft.Restier.Core.Authorization Namespace ## Types ### Classes | Name | Summary | | - | - | | [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry) | Describes the methods of verifying various CRUD operations for a given EF Entity. Useful in code generation scenarios | | [AuthorizationFactory](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationFactory) | Maintains a Dictionary of [AuthorizationEntry](/restier/api-reference/Microsoft/Restier/Core/Authorization/AuthorizationEntry)AuthorizationEntries\ for eacy access by Restier's Authorization framework. | # ChangeSetValidationException Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ChangeSetValidationException Represents an exception that indicates validation errors occurred on entities. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ChangeSetValidationException ``` ## Summary Represents an exception that indicates validation errors occurred on entities. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ChangeSetValidationException() ``` ### .ctor Initializes a new instance of the [ChangeSetValidationException](/restier/api-reference/Microsoft/Restier/Core/ChangeSetValidationException) class. #### Syntax ```csharp theme={"dark"} public ChangeSetValidationException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Message of the exception. | ### .ctor Initializes a new instance of the [ChangeSetValidationException](/restier/api-reference/Microsoft/Restier/Core/ChangeSetValidationException) class. #### Syntax ```csharp theme={"dark"} public ChangeSetValidationException(string message, System.Exception innerException) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Message of the exception. | | `innerException` | `System.Exception` | Inner exception. | ## Properties ### ValidationResults Gets or sets the failed validation results. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IEnumerable ValidationResults { get; set; } ``` #### Property Value Type: `System.Collections.Generic.IEnumerable` # ConventionBasedChangeSetItemAuthorizer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemAuthorizer A convention-based change set item authorizer. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionBasedChangeSetItemAuthorizer ``` ## Summary A convention-based change set item authorizer. ## Constructors ### .ctor Initializes a new instance of the [ConventionBasedChangeSetItemAuthorizer](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemAuthorizer) class. #### Syntax ```csharp theme={"dark"} public ConventionBasedChangeSetItemAuthorizer(System.Type targetApiType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `targetApiType` | `System.Type` | The target type to check for authorizer functions. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### AuthorizeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AuthorizeAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | - | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Restier.Core.Submit.IChangeSetItemAuthorizer # ConventionBasedChangeSetItemFilter Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemFilter A convention-based change set item processor which calls logic like OnInserting and OnInserted. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionBasedChangeSetItemFilter ``` ## Summary A convention-based change set item processor which calls logic like OnInserting and OnInserted. ## Constructors ### .ctor Initializes a new instance of the [ConventionBasedChangeSetItemFilter](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemFilter) class. #### Syntax ```csharp theme={"dark"} public ConventionBasedChangeSetItemFilter(System.Type targetApiType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `targetApiType` | `System.Type` | The target type to check for filter functions. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnChangeSetItemProcessedAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnChangeSetItemProcessedAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | - | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### OnChangeSetItemProcessingAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnChangeSetItemProcessingAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | - | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Restier.Core.Submit.IChangeSetItemFilter # ConventionBasedChangeSetItemValidator Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemValidator A convention-based change set item validator. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionBasedChangeSetItemValidator ``` ## Summary A convention-based change set item validator. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ConventionBasedChangeSetItemValidator() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### ValidateChangeSetItemAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ValidateChangeSetItemAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Collections.ObjectModel.Collection validationResults, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | - | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | - | | `validationResults` | `System.Collections.ObjectModel.Collection` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ## Related APIs * Microsoft.Restier.Core.Submit.IChangeSetItemValidator # ConventionBasedMethodNameFactory Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionBasedMethodNameFactory A set of string factory methods than generate Restier names for various possible operations. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionBasedMethodNameFactory ``` ## Summary A set of string factory methods than generate Restier names for various possible operations. ## Methods ### GetEntitySetMethodName Generates the complete MethodName for a given [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport), [RestierPipelineState](/restier/api-reference/Microsoft/Restier/Core/RestierPipelineState), and [RestierEntitySetOperation](/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation). #### Syntax ```csharp theme={"dark"} public static string GetEntitySetMethodName(Microsoft.OData.Edm.IEdmEntitySet entitySet, Microsoft.Restier.Core.RestierPipelineState restierPipelineState, Microsoft.Restier.Core.RestierEntitySetOperation operation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Edm.IEdmEntitySet` | The [IEdmEntitySet](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmentityset) that contains the details for the EntitySet and the Entities it holds. | | `restierPipelineState` | `Microsoft.Restier.Core.RestierPipelineState` | The part of the Restier pipeline currently executing. | | `operation` | `Microsoft.Restier.Core.RestierEntitySetOperation` | The [RestierEntitySetOperation](/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation) currently being executed. | #### Returns Type: `string` A string representing the fully-realized MethodName. ### GetEntitySetMethodName Generates the complete MethodName for a given [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport), [RestierPipelineState](/restier/api-reference/Microsoft/Restier/Core/RestierPipelineState), and [RestierEntitySetOperation](/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation). #### Syntax ```csharp theme={"dark"} public static string GetEntitySetMethodName(Microsoft.Restier.Core.Submit.DataModificationItem item, Microsoft.Restier.Core.RestierPipelineState restierPipelineState) ``` #### Parameters | Name | Type | Description | | - | - | - | | `item` | `Microsoft.Restier.Core.Submit.DataModificationItem` | The [DataModificationItem](/restier/api-reference/Microsoft/Restier/Core/Submit/DataModificationItem) that contains the details for the EntitySet and the Entities it holds. | | `restierPipelineState` | `Microsoft.Restier.Core.RestierPipelineState` | The part of the Restier pipeline currently executing. | #### Returns Type: `string` A string representing the fully-realized MethodName. ### GetFunctionMethodName Generates the complete MethodName for a given [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport), [RestierPipelineState](/restier/api-reference/Microsoft/Restier/Core/RestierPipelineState), and [RestierEntitySetOperation](/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation). #### Syntax ```csharp theme={"dark"} public static string GetFunctionMethodName(Microsoft.OData.Edm.IEdmOperationImport operationImport, Microsoft.Restier.Core.RestierPipelineState restierPipelineState, Microsoft.Restier.Core.RestierOperationMethod restierOperation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operationImport` | `Microsoft.OData.Edm.IEdmOperationImport` | The [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport) to generate a name for. | | `restierPipelineState` | `Microsoft.Restier.Core.RestierPipelineState` | The part of the Restier pipeline currently executing. | | `restierOperation` | `Microsoft.Restier.Core.RestierOperationMethod` | The [RestierOperationMethod](/restier/api-reference/Microsoft/Restier/Core/RestierOperationMethod) currently being executed. | #### Returns Type: `string` A string representing the fully-realized MethodName. ### GetFunctionMethodName Generates the complete MethodName for a given [OperationContext](/restier/api-reference/Microsoft/Restier/Core/Operation/OperationContext), [RestierPipelineState](/restier/api-reference/Microsoft/Restier/Core/RestierPipelineState), and [RestierEntitySetOperation](/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation). #### Syntax ```csharp theme={"dark"} public static string GetFunctionMethodName(Microsoft.Restier.Core.Operation.OperationContext operationImport, Microsoft.Restier.Core.RestierPipelineState restierPipelineState, Microsoft.Restier.Core.RestierOperationMethod restierOperation) ``` #### Parameters | Name | Type | Description | | - | - | - | | `operationImport` | `Microsoft.Restier.Core.Operation.OperationContext` | The [OperationContext](/restier/api-reference/Microsoft/Restier/Core/Operation/OperationContext) to generate a name for. | | `restierPipelineState` | `Microsoft.Restier.Core.RestierPipelineState` | The part of the Restier pipeline currently executing. | | `restierOperation` | `Microsoft.Restier.Core.RestierOperationMethod` | The [RestierOperationMethod](/restier/api-reference/Microsoft/Restier/Core/RestierOperationMethod) currently being executed. | #### Returns Type: `string` A string representing the fully-realized MethodName. # ConventionBasedOperationAuthorizer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionBasedOperationAuthorizer A convention-based operation authorizer. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionBasedOperationAuthorizer ``` ## Summary A convention-based operation authorizer. ## Constructors ### .ctor Initializes a new instance of the [ConventionBasedOperationAuthorizer](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedOperationAuthorizer) class. #### Syntax ```csharp theme={"dark"} public ConventionBasedOperationAuthorizer(System.Type targetApiType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `targetApiType` | `System.Type` | The target type to check for authorizer functions. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### AuthorizeAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task AuthorizeAsync(Microsoft.Restier.Core.Operation.OperationContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Operation.OperationContext` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Restier.Core.Operation.IOperationAuthorizer # ConventionBasedOperationFilter Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionBasedOperationFilter A convention-based change set item filter. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionBasedOperationFilter ``` ## Summary A convention-based change set item filter. ## Constructors ### .ctor Initializes a new instance of the [ConventionBasedOperationFilter](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedOperationFilter) class. #### Syntax ```csharp theme={"dark"} public ConventionBasedOperationFilter(System.Type targetApiType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `targetApiType` | `System.Type` | The target type to check for filter functions. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### OnOperationExecutedAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnOperationExecutedAsync(Microsoft.Restier.Core.Operation.OperationContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Operation.OperationContext` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### OnOperationExecutingAsync #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task OnOperationExecutingAsync(Microsoft.Restier.Core.Operation.OperationContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Operation.OperationContext` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Restier.Core.Operation.IOperationFilter # ConventionBasedQueryExpressionProcessor Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionBasedQueryExpressionProcessor A convention-based query expression processor which will apply OnFilter logic into query expression. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionBasedQueryExpressionProcessor ``` ## Summary A convention-based query expression processor which will apply OnFilter logic into query expression. ## Constructors ### .ctor Initializes a new instance of the [ConventionBasedQueryExpressionProcessor](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedQueryExpressionProcessor) class. #### Syntax ```csharp theme={"dark"} public ConventionBasedQueryExpressionProcessor(System.Type targetApiType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `targetApiType` | `System.Type` | The target type to check for filter functions. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Inner Gets a reference to an inner query expression processor in case they are chained. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Query.IQueryExpressionProcessor Inner { get; set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Query.IQueryExpressionProcessor` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### Process #### Syntax ```csharp theme={"dark"} public System.Linq.Expressions.Expression Process(Microsoft.Restier.Core.Query.QueryExpressionContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Query.QueryExpressionContext` | - | #### Returns Type: `System.Linq.Expressions.Expression` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Restier.Core.Query.IQueryExpressionProcessor # ConventionInvocationException Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/ConventionInvocationException Represents an exception that indicates validation errors occurred on entities. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.ConventionInvocationException ``` ## Summary Represents an exception that indicates validation errors occurred on entities. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ConventionInvocationException() ``` ### .ctor Initializes a new instance of the [EdmModelValidationException](/restier/api-reference/Microsoft/Restier/Core/EdmModelValidationException) class. #### Syntax ```csharp theme={"dark"} public ConventionInvocationException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Message of the exception. | ### .ctor Initializes a new instance of the [EdmModelValidationException](/restier/api-reference/Microsoft/Restier/Core/EdmModelValidationException) class. #### Syntax ```csharp theme={"dark"} public ConventionInvocationException(string message, System.Exception innerException) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Message of the exception. | | `innerException` | `System.Exception` | Inner exception. | # DataSourceStub Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/DataSourceStub Represents method stubs that identify API data source. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.DataSourceStub ``` ## Summary Represents method stubs that identify API data source. ## Remarks The methods in this class are stubs that identify API data source inside a query expression. This is a generic way to reference a data source in API. Later in the query pipeline the sourcer from the data provider will replace the stub with the actual data source. ## Methods ### GetPropertyValue Identifies the value of an extended property of an object. #### Syntax ```csharp theme={"dark"} public static TResult GetPropertyValue(object source, string propertyName) ``` #### Parameters | Name | Type | Description | | - | - | - | | `source` | `object` | A source object. | | `propertyName` | `string` | The name of a property. | #### Returns Type: `TResult` A representation of the value of the extended property of the object. #### Type Parameters * `TResult` - The type of the result. ### GetQueryableSource Identifies an entity set, singleton or queryable data resulting from a call to a composable function import. #### Syntax ```csharp theme={"dark"} public static System.Linq.IQueryable GetQueryableSource(string name, params object[] arguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name of an entity set, singleton or composable function import. | | `arguments` | `object[]` | If *name* is a composable function import, | | the arguments to be passed to the composable function import. | | | #### Returns Type: `System.Linq.IQueryable` A representation of the entity set, singleton or queryable data resulting from a call to the composable function import. #### Type Parameters * `TElement` - The type of the elements in the queryable data. ### GetQueryableSource Identifies queryable data resulting from a call to a composable function. #### Syntax ```csharp theme={"dark"} public static System.Linq.IQueryable GetQueryableSource(string namespaceName, string name, params object[] arguments) ``` #### Parameters | Name | Type | Description | | - | - | - | | `namespaceName` | `string` | The name of a namespace containing the composable function. | | `name` | `string` | The name of a composable function. | | `arguments` | `object[]` | The arguments to be passed to the composable function. | #### Returns Type: `System.Linq.IQueryable` A representation of the queryable data resulting from a call to the composable function. #### Type Parameters * `TElement` - The type of the elements in the queryable data. # EdmModelValidationException Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/EdmModelValidationException Represents an exception that indicates validation errors occurred on entities. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.EdmModelValidationException ``` ## Summary Represents an exception that indicates validation errors occurred on entities. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EdmModelValidationException() ``` ### .ctor Initializes a new instance of the [EdmModelValidationException](/restier/api-reference/Microsoft/Restier/Core/EdmModelValidationException) class. #### Syntax ```csharp theme={"dark"} public EdmModelValidationException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Message of the exception. | ### .ctor Initializes a new instance of the [EdmModelValidationException](/restier/api-reference/Microsoft/Restier/Core/EdmModelValidationException) class. #### Syntax ```csharp theme={"dark"} public EdmModelValidationException(string message, System.Exception innerException) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Message of the exception. | | `innerException` | `System.Exception` | Inner exception. | # InvocationContext Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/InvocationContext Represents context under which an request is processed. The request could be a query, a submit, an operation execution or a model retrieve. ... ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.InvocationContext ``` ## Summary Represents context under which an request is processed. The request could be a query, a submit, an operation execution or a model retrieve. It has subclass for each kinds of request. ## Remarks An invocation context is created each time an request is parsed to a specified request. ## Constructors ### .ctor Initializes a new instance of the [InvocationContext](/restier/api-reference/Microsoft/Restier/Core/InvocationContext) class. #### Syntax ```csharp theme={"dark"} public InvocationContext(Microsoft.Restier.Core.ApiBase api) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Api Gets the [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) descendant for this invocation. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.ApiBase Api { get; } ``` #### Property Value Type: `Microsoft.Restier.Core.ApiBase` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetApiService Gets an API service. #### Syntax ```csharp theme={"dark"} public T GetApiService() where T : class ``` #### Returns Type: `T` The API service instance. #### Type Parameters * `T` - The API service type. ### GetApiService Gets an API service. #### Syntax ```csharp theme={"dark"} public object GetApiService(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The API service type. | #### Returns Type: `object` The API service instance. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IModelBuilder Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Model/IModelBuilder The service for model generation. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Model ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Model.IModelBuilder ``` ## Summary The service for model generation. ## Methods ### GetModel Abstract Asynchronously gets an API model for an API. #### Syntax ```csharp theme={"dark"} Microsoft.OData.Edm.IEdmModel GetModel(Microsoft.Restier.Core.Model.ModelContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Model.ModelContext` | The context for processing | #### Returns Type: `Microsoft.OData.Edm.IEdmModel` A task that represents the asynchronous operation whose result is the API model. # IModelMapper Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Model/IModelMapper Represents a service that maps between the model space and the object space. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Model ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Model.IModelMapper ``` ## Summary Represents a service that maps between the model space and the object space. ## Methods ### TryGetRelevantType Abstract Tries to get the relevant type of an entity set, singleton, or composable function import. #### Syntax ```csharp theme={"dark"} bool TryGetRelevantType(Microsoft.Restier.Core.Model.ModelContext context, string name, out System.Type relevantType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Model.ModelContext` | The context for model mapper. | | `name` | `string` | The name of an entity set, singleton or composable function import. | | `relevantType` | `System.Type` | When this method returns, provides the | | relevant type of the queryable source. | | | #### Returns Type: `bool` `true` if the relevant type was provided; otherwise, `false`. #### Remarks For entity sets, the relevant type is its element entity type. For singletons, the relevant type is the singleton entity type. For composable function imports, the relevant type is the return type if it is a primitive, complex or entity type, or the element type of the return type if it is a collection type. This method can return true and assign `null` as the relevant type when it is overriding a previously registered service and specifically opting to not support the specified queryable source. ### TryGetRelevantType Abstract Tries to get the relevant type of a composable function. #### Syntax ```csharp theme={"dark"} bool TryGetRelevantType(Microsoft.Restier.Core.Model.ModelContext context, string namespaceName, string name, out System.Type relevantType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Model.ModelContext` | The context for model mapper. | | `namespaceName` | `string` | The name of a namespace containing a composable function. | | `name` | `string` | The name of composable function. | | `relevantType` | `System.Type` | When this method returns, provides the | | relevant type of the composable function. | | | #### Returns Type: `bool` `true` if the relevant type was provided; otherwise, `false`. #### Remarks For composable functions, the relevant type is the return type if it is a primitive, complex or entity type, or the element type of the return type if it is a collection type. This method can return true and assign `null` as the relevant type when it is overriding a previously registered service and specifically opting to not support the specified composable function. # ModelContext Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Model/ModelContext Represents context under which a model is requested. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Model **Inheritance:** Microsoft.Restier.Core.InvocationContext ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Model.ModelContext ``` ## Summary Represents context under which a model is requested. ## Constructors ### .ctor Initializes a new instance of the [ModelContext](/restier/api-reference/Microsoft/Restier/Core/Model/ModelContext) class. #### Syntax ```csharp theme={"dark"} public ModelContext(Microsoft.Restier.Core.ApiBase api) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | ### .ctor Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Initializes a new instance of the [InvocationContext](/restier/api-reference/Microsoft/Restier/Core/InvocationContext) class. #### Syntax ```csharp theme={"dark"} public InvocationContext(Microsoft.Restier.Core.ApiBase api) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Api Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets the [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) descendant for this invocation. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.ApiBase Api { get; } ``` #### Property Value Type: `Microsoft.Restier.Core.ApiBase` ### ResourceSetTypeMap Gets resource set and resource type map dictionary, it will be used by publisher for model build. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IDictionary ResourceSetTypeMap { get; } ``` #### Property Value Type: `System.Collections.Generic.IDictionary` ### ResourceTypeKeyPropertiesMap Gets resource type and its key properties map dictionary, and used by publisher for model build. This is useful when key properties does not have key attribute or follow Web Api OData key property naming convention. Otherwise, this collection is not needed. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IDictionary> ResourceTypeKeyPropertiesMap { get; } ``` #### Property Value Type: `System.Collections.Generic.IDictionary>` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public T GetApiService() where T : class ``` #### Returns Type: `T` The API service instance. #### Type Parameters * `T` - The API service type. ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public object GetApiService(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The API service type. | #### Returns Type: `object` The API service instance. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Model/index Summary of the Microsoft.Restier.Core.Model Namespace ## Types ### Classes | Name | Summary | | - | - | | [ModelContext](/restier/api-reference/Microsoft/Restier/Core/Model/ModelContext) | Represents context under which a model is requested. | ### Interfaces | Name | Summary | | - | - | | [IModelBuilder](/restier/api-reference/Microsoft/Restier/Core/Model/IModelBuilder) | The service for model generation. | | [IModelMapper](/restier/api-reference/Microsoft/Restier/Core/Model/IModelMapper) | Represents a service that maps between the model space and the object space. | # IOperationAuthorizer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Operation/IOperationAuthorizer Represents a operation authorizer. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Operation ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Operation.IOperationAuthorizer ``` ## Summary Represents a operation authorizer. ## Methods ### AuthorizeAsync Abstract Asynchronously authorizes the Operation. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task AuthorizeAsync(Microsoft.Restier.Core.Operation.OperationContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Operation.OperationContext` | The operation context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. # IOperationExecutor Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Operation/IOperationExecutor Represents a service that executes an operation. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Operation ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Operation.IOperationExecutor ``` ## Summary Represents a service that executes an operation. ## Methods ### ExecuteOperationAsync Abstract Asynchronously executes an operation. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ExecuteOperationAsync(Microsoft.Restier.Core.Operation.OperationContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Operation.OperationContext` | The operation context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation whose result is a operation result. # IOperationFilter Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Operation/IOperationFilter Represents a operation processor. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Operation ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Operation.IOperationFilter ``` ## Summary Represents a operation processor. ## Methods ### OnOperationExecutedAsync Abstract Asynchronously applies logic after an operation is executed. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task OnOperationExecutedAsync(Microsoft.Restier.Core.Operation.OperationContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Operation.OperationContext` | The submit context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. ### OnOperationExecutingAsync Abstract Asynchronously applies logic before a operation is executed. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task OnOperationExecutingAsync(Microsoft.Restier.Core.Operation.OperationContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Operation.OperationContext` | The operation context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. # OperationContext Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Operation/OperationContext Represents context under which a operation is executed. One instance created for one execution of one operation. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Operation **Inheritance:** Microsoft.Restier.Core.InvocationContext ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Operation.OperationContext ``` ## Summary Represents context under which a operation is executed. One instance created for one execution of one operation. ## Constructors ### .ctor Initializes a new instance of the [OperationContext](/restier/api-reference/Microsoft/Restier/Core/Operation/OperationContext) class. #### Syntax ```csharp theme={"dark"} public OperationContext(Microsoft.Restier.Core.ApiBase api, System.Func getParameterValueFunc, string operationName, bool isFunction, System.Collections.IEnumerable bindingParameterValue) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | | `getParameterValueFunc` | `System.Func` | The function that used to retrieve the parameter value name. | | `operationName` | `string` | The operation name. | | `isFunction` | `bool` | A flag indicates this is a function call or action call. | | `bindingParameterValue` | `System.Collections.IEnumerable` | A queryable for binding parameter value and if it is function/action import, the value will be null. | ### .ctor Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Initializes a new instance of the [InvocationContext](/restier/api-reference/Microsoft/Restier/Core/InvocationContext) class. #### Syntax ```csharp theme={"dark"} public InvocationContext(Microsoft.Restier.Core.ApiBase api) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Api Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets the [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) descendant for this invocation. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.ApiBase Api { get; } ``` #### Property Value Type: `Microsoft.Restier.Core.ApiBase` ### BindingParameterValue Gets the queryable for binding parameter value, and if it is function/action import, the value will be null. #### Syntax ```csharp theme={"dark"} public System.Collections.IEnumerable BindingParameterValue { get; } ``` #### Property Value Type: `System.Collections.IEnumerable` ### GetParameterValueFunc Gets the function that used to retrieve the parameter value name. #### Syntax ```csharp theme={"dark"} public System.Func GetParameterValueFunc { get; } ``` #### Property Value Type: `System.Func` ### IsFunction Gets a value indicating whether it is a function call or action call. #### Syntax ```csharp theme={"dark"} public bool IsFunction { get; } ``` #### Property Value Type: `bool` ### OperationName Gets the operation name. #### Syntax ```csharp theme={"dark"} public string OperationName { get; } ``` #### Property Value Type: `string` ### ParameterValues Gets or sets the parameters value array used by method, It is only set after parameters are prepared. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.ICollection ParameterValues { get; set; } ``` #### Property Value Type: `System.Collections.Generic.ICollection` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public T GetApiService() where T : class ``` #### Returns Type: `T` The API service instance. #### Type Parameters * `T` - The API service type. ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public object GetApiService(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The API service type. | #### Returns Type: `object` The API service instance. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Operation/index Summary of the Microsoft.Restier.Core.Operation Namespace ## Types ### Classes | Name | Summary | | - | - | | [OperationContext](/restier/api-reference/Microsoft/Restier/Core/Operation/OperationContext) | Represents context under which a operation is executed. One instance created for one execution of one operation. | ### Interfaces | Name | Summary | | - | - | | [IOperationAuthorizer](/restier/api-reference/Microsoft/Restier/Core/Operation/IOperationAuthorizer) | Represents a operation authorizer. | | [IOperationExecutor](/restier/api-reference/Microsoft/Restier/Core/Operation/IOperationExecutor) | Represents a service that executes an operation. | | [IOperationFilter](/restier/api-reference/Microsoft/Restier/Core/Operation/IOperationFilter) | Represents a operation processor. | # DataSourceStubModelReference Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/DataSourceStubModelReference Represents a reference to data source stub in terms of a model. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** Microsoft.Restier.Core.Query.QueryModelReference ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.DataSourceStubModelReference ``` ## Summary Represents a reference to data source stub in terms of a model. ## Constructors ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` #### Syntax ```csharp theme={"dark"} internal QueryModelReference() ``` ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` #### Syntax ```csharp theme={"dark"} internal QueryModelReference(Microsoft.OData.Edm.IEdmEntitySet entitySet, Microsoft.OData.Edm.IEdmType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Edm.IEdmEntitySet` | - | | `type` | `Microsoft.OData.Edm.IEdmType` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Element Gets the element representing the API data. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Edm.IEdmElement Element { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmElement` ### EntitySet Override Gets the entity set that ultimately contains the data. #### Syntax ```csharp theme={"dark"} public override Microsoft.OData.Edm.IEdmEntitySet EntitySet { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmEntitySet` ### EntitySet Inherited Virtual Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` Gets the entity set that ultimately contains the data. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmEntitySet EntitySet { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmEntitySet` ### Type Override Gets the type of the data, if any. #### Syntax ```csharp theme={"dark"} public override Microsoft.OData.Edm.IEdmType Type { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmType` ### Type Inherited Virtual Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` Gets the type of the data, if any. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmType Type { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmType` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IQueryExecutor Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExecutor Represents a service that executes a query. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.IQueryExecutor ``` ## Summary Represents a service that executes a query. ## Remarks Data provider implemented IQueryExecutor should only handle queries against the specific provider, and delegates all other queries to inner IQueryExecutor. ## Methods ### ExecuteExpressionAsync Abstract Asynchronously executes a singleton query and produces a query result. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ExecuteExpressionAsync(Microsoft.Restier.Core.Query.QueryContext context, System.Linq.IQueryProvider queryProvider, System.Linq.Expressions.Expression expression, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Query.QueryContext` | The query context. | | `queryProvider` | `System.Linq.IQueryProvider` | A query provider to execute the expression. | | `expression` | `System.Linq.Expressions.Expression` | An expression to be composed on the base query. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation whose result is a query result. #### Type Parameters * `TResult` - The type of the singleton query result. ### ExecuteQueryAsync Abstract Asynchronously executes a query and produces a query result. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ExecuteQueryAsync(Microsoft.Restier.Core.Query.QueryContext context, System.Linq.IQueryable query, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Query.QueryContext` | The query context. | | `query` | `System.Linq.IQueryable` | A composed query. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation whose result is a query result. #### Type Parameters * `TElement` - The type of the elements in the query. # IQueryExpressionAuthorizer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionAuthorizer Represents a service that inspects a query expression. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.IQueryExpressionAuthorizer ``` ## Summary Represents a service that inspects a query expression. ## Remarks Query expression inspection evaluates an expression to determine if it is valid according to API logic such as authorization rules. Inspection is the first step that occurs when processing a query expression after its children have been visited, so it occurs during upward traversal of the query expression. This ensures that inspection has a chance to take place before the node is altered in any way (with the exception of normalization of expressions identifying API data). ## Methods ### Authorize Abstract Check an expression to see whether it is authorized. #### Syntax ```csharp theme={"dark"} bool Authorize(Microsoft.Restier.Core.Query.QueryExpressionContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Query.QueryExpressionContext` | The query expression context. | #### Returns Type: `bool` `true` if the inspection passed; otherwise, `false`. # IQueryExpressionExpander Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionExpander Represents a service that expands a query expression. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.IQueryExpressionExpander ``` ## Summary Represents a service that expands a query expression. ## Remarks Query expression expansion converts an expression that represents normalized API data into an expression using more primitive nodes. Expansion is the second step that occurs when processing a query expression after its children have been visited, so it occurs during upward traversal of the query expression and after inspection. Since expansion fundamentally alters the query expression, the resulting expression is recursively processed to ensure that all appropriate normalization, inspection, expansion, filtering and sourcing occurs. ## Methods ### Expand Abstract Expands an expression. #### Syntax ```csharp theme={"dark"} System.Linq.Expressions.Expression Expand(Microsoft.Restier.Core.Query.QueryExpressionContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Query.QueryExpressionContext` | The query expression context. | #### Returns Type: `System.Linq.Expressions.Expression` An expanded expression of the same type as the visited node, or if expansion did not apply, the visited node or `null`. # IQueryExpressionProcessor Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionProcessor Represents a service that processes a query expression. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.IQueryExpressionProcessor ``` ## Summary Represents a service that processes a query expression. ## Remarks Query expression processing converts an expression node into a different expression node according to API logic such as a restricting filter on top of some composable API data. Processing is the third step that occurs when visiting a query expression after its children have been visited, so it occurs during upward traversal of the query expression and after inspection and expansion. Since processing fundamentally alters the query expression, the resulting expression is recursively processed to ensure that all appropriate normalization, inspection, expansion, processing and sourcing occurs. ## Methods ### Process Abstract Processes an expression. #### Syntax ```csharp theme={"dark"} System.Linq.Expressions.Expression Process(Microsoft.Restier.Core.Query.QueryExpressionContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Query.QueryExpressionContext` | The query expression context. | #### Returns Type: `System.Linq.Expressions.Expression` A processed expression of the same type as the visited node, or if processing did not apply, the visited node. # IQueryExpressionSourcer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionSourcer Represents a service that replace queryable source of an expression. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.IQueryExpressionSourcer ``` ## Summary Represents a service that replace queryable source of an expression. ## Remarks Query expression sourcing converts an expression that identifies API data in a normalized manner to an equivalent representation in terms of the underlying data source proxy. Sourcing is the last step that occurs when processing a query expression, and only happens on expressions that represent API data that cannot be expanded into any more primitive of an expression. ## Methods ### ReplaceQueryableSource Abstract Replace queryable source of an expression. #### Syntax ```csharp theme={"dark"} System.Linq.Expressions.Expression ReplaceQueryableSource(Microsoft.Restier.Core.Query.QueryExpressionContext context, bool embedded) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Query.QueryExpressionContext` | The query expression context. | | `embedded` | `bool` | Indicates if the sourcing is occurring on an embedded node. | #### Returns Type: `System.Linq.Expressions.Expression` A data source expression that represents the visited node. #### Remarks When *embedded* is `false`, this method should produce a constant expression whose value is a queryable object produced by calling into the underlying data source proxy. When *embedded* is `true`, this method should return an expression that represents the API data identified by the visited node in terms of the underlying data source proxy. Consider an example where the data source API has a method to get a query over customers, accessed through "data.GetCustomers()". When *embedded* is false, this method should call that method and return a constant expression containing the query. When *embedded* is true, this method should build a call expression to "GetCustomers" where the object to which it applies is a constant expression whose value is the data object. # ParameterModelReference Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/ParameterModelReference Represents a reference to parameter data in terms of a model. It does not have special logic ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** Microsoft.Restier.Core.Query.QueryModelReference ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.ParameterModelReference ``` ## Summary Represents a reference to parameter data in terms of a model. It does not have special logic ## Constructors ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` #### Syntax ```csharp theme={"dark"} internal QueryModelReference() ``` ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` #### Syntax ```csharp theme={"dark"} internal QueryModelReference(Microsoft.OData.Edm.IEdmEntitySet entitySet, Microsoft.OData.Edm.IEdmType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Edm.IEdmEntitySet` | - | | `type` | `Microsoft.OData.Edm.IEdmType` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### EntitySet Inherited Virtual Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` Gets the entity set that ultimately contains the data. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmEntitySet EntitySet { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmEntitySet` ### Type Inherited Virtual Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` Gets the type of the data, if any. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmType Type { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmType` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # PropertyModelReference Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/PropertyModelReference Represents a reference to property data in terms of a model. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** Microsoft.Restier.Core.Query.QueryModelReference ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.PropertyModelReference ``` ## Summary Represents a reference to property data in terms of a model. ## Constructors ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` #### Syntax ```csharp theme={"dark"} internal QueryModelReference() ``` ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` #### Syntax ```csharp theme={"dark"} internal QueryModelReference(Microsoft.OData.Edm.IEdmEntitySet entitySet, Microsoft.OData.Edm.IEdmType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entitySet` | `Microsoft.OData.Edm.IEdmEntitySet` | - | | `type` | `Microsoft.OData.Edm.IEdmType` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### EntitySet Override Gets the entity set that contains the data. #### Syntax ```csharp theme={"dark"} public override Microsoft.OData.Edm.IEdmEntitySet EntitySet { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmEntitySet` ### EntitySet Inherited Virtual Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` Gets the entity set that ultimately contains the data. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmEntitySet EntitySet { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmEntitySet` ### Property Gets the property representing the property data. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Edm.IEdmProperty Property { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmProperty` ### Source Gets the source of the derived data. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Query.QueryModelReference Source { get; private set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Query.QueryModelReference` ### Type Override Gets the type of the queryable data. #### Syntax ```csharp theme={"dark"} public override Microsoft.OData.Edm.IEdmType Type { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmType` ### Type Inherited Virtual Inherited from `Microsoft.Restier.Core.Query.QueryModelReference` Gets the type of the data, if any. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmType Type { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmType` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # QueryContext Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/QueryContext Represents context under which a query flow operates. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** Microsoft.Restier.Core.InvocationContext ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.QueryContext ``` ## Summary Represents context under which a query flow operates. ## Constructors ### .ctor Initializes a new instance of the [QueryContext](/restier/api-reference/Microsoft/Restier/Core/Query/QueryContext) class. #### Syntax ```csharp theme={"dark"} public QueryContext(Microsoft.Restier.Core.ApiBase api, Microsoft.Restier.Core.Query.QueryRequest request) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | | `request` | `Microsoft.Restier.Core.Query.QueryRequest` | A query request. | ### .ctor Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Initializes a new instance of the [InvocationContext](/restier/api-reference/Microsoft/Restier/Core/InvocationContext) class. #### Syntax ```csharp theme={"dark"} public InvocationContext(Microsoft.Restier.Core.ApiBase api) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Api Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets the [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) descendant for this invocation. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.ApiBase Api { get; } ``` #### Property Value Type: `Microsoft.Restier.Core.ApiBase` ### Model Gets the model that informs this query context. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Edm.IEdmModel Model { get; internal set; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmModel` ### Request Gets the query request. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Query.QueryRequest Request { get; private set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Query.QueryRequest` #### Remarks The query request cannot be set if there is already a result. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public T GetApiService() where T : class ``` #### Returns Type: `T` The API service instance. #### Type Parameters * `T` - The API service type. ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public object GetApiService(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The API service type. | #### Returns Type: `object` The API service instance. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # QueryExpressionContext Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/QueryExpressionContext Represents context for a query expression that is used during query expression processing. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.QueryExpressionContext ``` ## Summary Represents context for a query expression that is used during query expression processing. ## Constructors ### .ctor Initializes a new instance of the [QueryExpressionContext](/restier/api-reference/Microsoft/Restier/Core/Query/QueryExpressionContext) class. #### Syntax ```csharp theme={"dark"} public QueryExpressionContext(Microsoft.Restier.Core.Query.QueryContext queryContext) ``` #### Parameters | Name | Type | Description | | - | - | - | | `queryContext` | `Microsoft.Restier.Core.Query.QueryContext` | A query context. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AfterNestedVisitCallback Gets or sets an action that is invoked after an expanded or filtered expression has been visited. #### Syntax ```csharp theme={"dark"} public System.Action AfterNestedVisitCallback { get; set; } ``` #### Property Value Type: `System.Action` ### ModelReference Gets a reference to the model element that represents the visited node. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Query.QueryModelReference ModelReference { get; } ``` #### Property Value Type: `Microsoft.Restier.Core.Query.QueryModelReference` ### QueryContext Gets the query context associated with this context. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Query.QueryContext QueryContext { get; private set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Query.QueryContext` ### VisitedNode Gets the expression node that is being visited. #### Syntax ```csharp theme={"dark"} public System.Linq.Expressions.Expression VisitedNode { get; } ``` #### Property Value Type: `System.Linq.Expressions.Expression` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetModelReferenceForNode Gets a reference to the model element that represents an expression node. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Query.QueryModelReference GetModelReferenceForNode(System.Linq.Expressions.Expression node) ``` #### Parameters | Name | Type | Description | | - | - | - | | `node` | `System.Linq.Expressions.Expression` | An expression node. | #### Returns Type: `Microsoft.Restier.Core.Query.QueryModelReference` A reference to the model element that represents the expression node. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PopVisitedNode Pops a visited node. #### Syntax ```csharp theme={"dark"} public void PopVisitedNode() ``` ### PushVisitedNode Pushes a visited node. #### Syntax ```csharp theme={"dark"} public void PushVisitedNode(System.Linq.Expressions.Expression visitedNode) ``` #### Parameters | Name | Type | Description | | - | - | - | | `visitedNode` | `System.Linq.Expressions.Expression` | A visited node. | ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ReplaceVisitedNode Replaces the visited node. #### Syntax ```csharp theme={"dark"} public void ReplaceVisitedNode(System.Linq.Expressions.Expression visitedNode) ``` #### Parameters | Name | Type | Description | | - | - | - | | `visitedNode` | `System.Linq.Expressions.Expression` | A new visited node. | ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # QueryModelReference Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/QueryModelReference Represents a reference to query data in terms of a model. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.QueryModelReference ``` ## Summary Represents a reference to query data in terms of a model. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### EntitySet Virtual Gets the entity set that ultimately contains the data. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmEntitySet EntitySet { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmEntitySet` ### Type Virtual Gets the type of the data, if any. #### Syntax ```csharp theme={"dark"} public virtual Microsoft.OData.Edm.IEdmType Type { get; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmType` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # QueryRequest Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/QueryRequest Represents a query request. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.QueryRequest ``` ## Summary Represents a query request. ## Constructors ### .ctor Initializes a new instance of the [QueryRequest](/restier/api-reference/Microsoft/Restier/Core/Query/QueryRequest) class with a composed query. #### Syntax ```csharp theme={"dark"} public QueryRequest(System.Linq.IQueryable query) ``` #### Parameters | Name | Type | Description | | - | - | - | | `query` | `System.Linq.IQueryable` | A composed query that was derived from a queryable source. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Expression Gets or sets the composed query expression. #### Syntax ```csharp theme={"dark"} public System.Linq.Expressions.Expression Expression { get; set; } ``` #### Property Value Type: `System.Linq.Expressions.Expression` ### ShouldReturnCount Gets or sets a value indicating whether the number of the items should be returned instead of the items themselves. #### Syntax ```csharp theme={"dark"} public bool ShouldReturnCount { get; set; } ``` #### Property Value Type: `bool` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # QueryResult Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/QueryResult Represents a query result. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Query **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Query.QueryResult ``` ## Summary Represents a query result. ## Constructors ### .ctor Initializes a new instance of the [QueryResult](/restier/api-reference/Microsoft/Restier/Core/Query/QueryResult) class with an Exception. #### Syntax ```csharp theme={"dark"} public QueryResult(System.Exception exception) ``` #### Parameters | Name | Type | Description | | - | - | - | | `exception` | `System.Exception` | An Exception. | ### .ctor Initializes a new instance of the [QueryResult](/restier/api-reference/Microsoft/Restier/Core/Query/QueryResult) class with in-memory results. #### Syntax ```csharp theme={"dark"} public QueryResult(System.Collections.IEnumerable results) ``` #### Parameters | Name | Type | Description | | - | - | - | | `results` | `System.Collections.IEnumerable` | In-memory results. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Exception Gets or sets an Exception to be returned. #### Syntax ```csharp theme={"dark"} public System.Exception Exception { get; set; } ``` #### Property Value Type: `System.Exception` #### Remarks Setting this value will override any existing Exception or results. ### Results Gets or sets the in-memory results. #### Syntax ```csharp theme={"dark"} public System.Collections.IEnumerable Results { get; set; } ``` #### Property Value Type: `System.Collections.IEnumerable` #### Remarks Setting this value will override any existing Exception or results. ### ResultsSource Gets or sets the entity set from which the results were sourced. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.Edm.IEdmEntitySet ResultsSource { get; set; } ``` #### Property Value Type: `Microsoft.OData.Edm.IEdmEntitySet` #### Remarks This property will be `null` if the results are not instances of a particular entity type that has an associated entity set. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Query/index Summary of the Microsoft.Restier.Core.Query Namespace ## Types ### Classes | Name | Summary | | - | - | | [ParameterModelReference](/restier/api-reference/Microsoft/Restier/Core/Query/ParameterModelReference) | Represents a reference to parameter data in terms of a model. It does not have special logic | | [PropertyModelReference](/restier/api-reference/Microsoft/Restier/Core/Query/PropertyModelReference) | Represents a reference to property data in terms of a model. | | [QueryContext](/restier/api-reference/Microsoft/Restier/Core/Query/QueryContext) | Represents context under which a query flow operates. | | [QueryExpressionContext](/restier/api-reference/Microsoft/Restier/Core/Query/QueryExpressionContext) | Represents context for a query expression that is used during query expression processing. | | [QueryModelReference](/restier/api-reference/Microsoft/Restier/Core/Query/QueryModelReference) | Represents a reference to query data in terms of a model. | | [DataSourceStubModelReference](/restier/api-reference/Microsoft/Restier/Core/Query/DataSourceStubModelReference) | Represents a reference to data source stub in terms of a model. | | [QueryRequest](/restier/api-reference/Microsoft/Restier/Core/Query/QueryRequest) | Represents a query request. | | [QueryResult](/restier/api-reference/Microsoft/Restier/Core/Query/QueryResult) | Represents a query result. | ### Interfaces | Name | Summary | | - | - | | [IQueryExecutor](/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExecutor) | Represents a service that executes a query. | | [IQueryExpressionAuthorizer](/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionAuthorizer) | Represents a service that inspects a query expression. | | [IQueryExpressionExpander](/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionExpander) | Represents a service that expands a query expression. | | [IQueryExpressionProcessor](/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionProcessor) | Represents a service that processes a query expression. | | [IQueryExpressionSourcer](/restier/api-reference/Microsoft/Restier/Core/Query/IQueryExpressionSourcer) | Represents a service that replace queryable source of an expression. | # RestierApiBuilder Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/RestierApiBuilder A fluent configuration helper that registers [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instances and tracks the additional Dependency Injectio... ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.RestierApiBuilder ``` ## Summary A fluent configuration helper that registers [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instances and tracks the additional Dependency Injection services those APIs need. ## Remarks The implementation of adding specific APIs is left to the implementing Web framework, either in ASP.NET or ASP.NET Core. The reason being that adding APIs requires Web runtime-speicific services that the Restier Core library cannot be not aware of. ## Constructors ### .ctor Creates a new [RestierApiBuilder](/restier/api-reference/Microsoft/Restier/Core/RestierApiBuilder) instance. #### Syntax ```csharp theme={"dark"} public RestierApiBuilder() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # RestierContainerBuilder Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/RestierContainerBuilder The default Dependency Injection container builder for Restier. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.RestierContainerBuilder ``` ## Summary The default Dependency Injection container builder for Restier. ## Constructors ### .ctor Initializes a new instance of the [RestierContainerBuilder](/restier/api-reference/Microsoft/Restier/Core/RestierContainerBuilder) class. #### Syntax ```csharp theme={"dark"} public RestierContainerBuilder(System.Action configureApis = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `configureApis` | `System.Action` | Action to configure the [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) registrations that are available to the Container. | #### Remarks The API registrations are re-created every time because new Containers are spun up per-route. It make make more sense to create a static instance to do this, so the Dictionary is only created once. ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### AddService Adds a service of *serviceType* with an *implementationType*. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.IContainerBuilder AddService(Microsoft.OData.ServiceLifetime lifetime, System.Type serviceType, System.Type implementationType) ``` #### Parameters | Name | Type | Description | | - | - | - | | `lifetime` | `Microsoft.OData.ServiceLifetime` | The lifetime of the service to register. | | `serviceType` | `System.Type` | The type of the service to register. | | `implementationType` | `System.Type` | The implementation type of the service. | #### Returns Type: `Microsoft.OData.IContainerBuilder` The [IContainerBuilder](https://learn.microsoft.com/dotnet/api/microsoft.odata.icontainerbuilder) instance itself. ### AddService Adds a service of *serviceType* with an *implementationFactory*. #### Syntax ```csharp theme={"dark"} public Microsoft.OData.IContainerBuilder AddService(Microsoft.OData.ServiceLifetime lifetime, System.Type serviceType, System.Func implementationFactory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `lifetime` | `Microsoft.OData.ServiceLifetime` | The lifetime of the service to register. | | `serviceType` | `System.Type` | The type of the service to register. | | `implementationFactory` | `System.Func` | The factory that creates the service. | #### Returns Type: `Microsoft.OData.IContainerBuilder` The [IContainerBuilder](https://learn.microsoft.com/dotnet/api/microsoft.odata.icontainerbuilder) instance itself. ### BuildContainer Virtual Builds a container which implements [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) and contains all the services registered for a specific route. #### Syntax ```csharp theme={"dark"} public virtual System.IServiceProvider BuildContainer() ``` #### Returns Type: `System.IServiceProvider` The [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider)dependency injection container\ for the registered services. #### Remarks RWM: For unit test scenarios, this container may be built without any APIs opr Routes. If you are experiencing unexpected behavior, turn on Tracing so you can see the warning messages Restier might be generating. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.OData.IContainerBuilder # RestierEntitySetOperation Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation Represents the Restier operations available to an EntitySet. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.RestierEntitySetOperation ``` ## Summary Represents the Restier operations available to an EntitySet. ## Values | Name | Value | Description | | - | - | - | | `Filter` | 1 | Represents a Filter operation. | | `Insert` | 2 | Represents an Insert operation. | | `Update` | 3 | Represents an Update operation. | | `Delete` | 4 | Represents a Delete operation. | # RestierOperationMethod Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/RestierOperationMethod Represents the Restier operations available to an [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport). ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.RestierOperationMethod ``` ## Summary Represents the Restier operations available to an [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport). ## Values | Name | Value | Description | | - | - | - | | `Execute` | 1 | Represents the OperationImport being executed. | # RestierPipelineState Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/RestierPipelineState Represents the different parts of the Restier request execution pipeline. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.RestierPipelineState ``` ## Summary Represents the different parts of the Restier request execution pipeline. ## Values | Name | Value | Description | | - | - | - | | `Authorization` | 1 | Represents the first step of the pipeline, when Restier checks to see if the call is allowed. | | `Validation` | 2 | Represents the second step of the pipeline, where the payload is validated. | | `PreSubmit` | 3 | Represents the third step of the pipeline, where the developer can change the payload before it is submitted. | | `Submit` | 4 | Represents the fourth step of the pipeline, where the action is executed against the Entity Framework DbContext. | | `PostSubmit` | 5 | Represents the fifth step of the pipeline, where you can spin off other work after the action has completed successfully. | # RestierRouteBuilder Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/RestierRouteBuilder A fluent configuration helper that maps [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instances to ASP.NET OData routes. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.RestierRouteBuilder ``` ## Summary A fluent configuration helper that maps [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instances to ASP.NET OData routes. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public RestierRouteBuilder() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MapApiRoute Maps the specified Restier API to an ASP.NET OData Route. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.RestierRouteBuilder MapApiRoute(string routeName, string routePrefix, bool allowBatching = true) where TApi : Microsoft.Restier.Core.ApiBase ``` #### Parameters | Name | Type | Description | | - | - | - | | `routeName` | `string` | The name of the Route. Used to map the Route to a specific OData per-route container. Defaults to 'RestierDefault'. | | `routePrefix` | `string` | A string | | `allowBatching` | `bool` | A boolean specifying if the RestierBatchHandler will be mapped to the '\$batch' route. | #### Returns Type: `Microsoft.Restier.Core.RestierRouteBuilder` The [RestierRouteBuilder](/restier/api-reference/Microsoft/Restier/Core/RestierRouteBuilder) instance to allow for fluent method chaining. #### Type Parameters * `TApi` - ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # StatusCodeException Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/StatusCodeException Use this exception when you want to return a specific status code ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core **Inheritance:** System.Exception ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.StatusCodeException ``` ## Summary Use this exception when you want to return a specific status code ## Constructors ### .ctor Initializes a new instance of the StatusCodeException class. #### Syntax ```csharp theme={"dark"} public StatusCodeException() ``` ### .ctor Initializes a new instance of the StatusCodeException class. #### Syntax ```csharp theme={"dark"} public StatusCodeException(string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Plain text error message for this exception. | ### .ctor Initializes a new instance of the StatusCodeException class. #### Syntax ```csharp theme={"dark"} public StatusCodeException(string message, System.Exception innerException) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `string` | Plain text error message for this exception. | | `innerException` | `System.Exception` | Exception that caused this exception to be thrown. | ### .ctor Initializes a new instance of the StatusCodeException class. #### Syntax ```csharp theme={"dark"} public StatusCodeException(System.Net.HttpStatusCode statusCode, string message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `statusCode` | `System.Net.HttpStatusCode` | - | | `message` | `string` | Plain text error message for this exception. | ### .ctor Initializes a new instance of the StatusCodeException class. #### Syntax ```csharp theme={"dark"} public StatusCodeException(System.Net.HttpStatusCode statusCode, string message, System.Exception innerException) ``` #### Parameters | Name | Type | Description | | - | - | - | | `statusCode` | `System.Net.HttpStatusCode` | - | | `message` | `string` | Plain text error message for this exception. | | `innerException` | `System.Exception` | Exception that caused this exception to be thrown. | ## Properties ### StatusCode #### Syntax ```csharp theme={"dark"} public System.Net.HttpStatusCode StatusCode { get; private set; } ``` #### Property Value Type: `System.Net.HttpStatusCode` # ChangeSet Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet Represents a change set. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.ChangeSet ``` ## Summary Represents a change set. ## Constructors ### .ctor Initializes a new instance of the [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet) class. #### Syntax ```csharp theme={"dark"} public ChangeSet() ``` ### .ctor Initializes a new instance of the [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet) class. #### Syntax ```csharp theme={"dark"} public ChangeSet(System.Collections.Generic.IEnumerable entries) ``` #### Parameters | Name | Type | Description | | - | - | - | | `entries` | `System.Collections.Generic.IEnumerable` | A set of change set entries. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Entries Gets the entries in this change set. #### Syntax ```csharp theme={"dark"} public System.Collections.Concurrent.ConcurrentQueue Entries { get; } ``` #### Property Value Type: `System.Collections.Concurrent.ConcurrentQueue` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ChangeSetItem Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSetItem Represents an item in a change set. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.ChangeSetItem ``` ## Summary Represents an item in a change set. ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasChanged Indicates whether this change set item is in a changed state. #### Syntax ```csharp theme={"dark"} public bool HasChanged() ``` #### Returns Type: `bool` Whether this change set item is in a changed state. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # ChangeSetItemValidationResult Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSetItemValidationResult Represents a single result when validating an entity, property, etc. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.ChangeSetItemValidationResult ``` ## Summary Represents a single result when validating an entity, property, etc. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public ChangeSetItemValidationResult() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Message Gets or sets the message to be displayed to the end user for this validation result. #### Syntax ```csharp theme={"dark"} public string Message { get; set; } ``` #### Property Value Type: `string` ### PropertyName Gets or sets the name of the property to which the validation result applies. If null, the validation result applies to the whole Target. #### Syntax ```csharp theme={"dark"} public string PropertyName { get; set; } ``` #### Property Value Type: `string` ### Severity Gets or sets the severity of this validation result. #### Syntax ```csharp theme={"dark"} public System.Diagnostics.Tracing.EventLevel Severity { get; set; } ``` #### Property Value Type: `System.Diagnostics.Tracing.EventLevel` ### Target Gets or sets the item to which the validation result applies. #### Syntax ```csharp theme={"dark"} public object Target { get; set; } ``` #### Property Value Type: `object` ### ValidatorType Gets or sets the identifier for this validation result. #### Syntax ```csharp theme={"dark"} public string ValidatorType { get; set; } ``` #### Property Value Type: `string` #### Remarks Id allows programmatic matching of validation results between tiers. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Override Returns the string that represents this validation result. #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` The string that represents this validation result. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # DataModificationItem Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/DataModificationItem Represents a data modification item in a change set. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** Microsoft.Restier.Core.Submit.DataModificationItem ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.DataModificationItem ``` ## Summary Represents a data modification item in a change set. ## Type Parameters * `T` - The resource type. ## Constructors ### .ctor Initializes a new instance of the [DataModificationItem\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.core.submit.datamodificationitem-1) class. #### Syntax ```csharp theme={"dark"} public DataModificationItem(string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.RestierEntitySetOperation action, System.Collections.Generic.IReadOnlyDictionary resourceKey, System.Collections.Generic.IReadOnlyDictionary originalValues, System.Collections.Generic.IReadOnlyDictionary localValues) ``` #### Parameters | Name | Type | Description | | - | - | - | | `resourceSetName` | `string` | The name of the resource set in question. | | `expectedResourceType` | `System.Type` | The type of the expected resource type in question. | | `actualResourceType` | `System.Type` | The type of the actual resource type in question. | | `action` | `Microsoft.Restier.Core.RestierEntitySetOperation` | The RestierEntitySetOperations for the request. | | `resourceKey` | `System.Collections.Generic.IReadOnlyDictionary` | The key of the resource being modified. | | `originalValues` | `System.Collections.Generic.IReadOnlyDictionary` | Any original values of the resource that are known. | | `localValues` | `System.Collections.Generic.IReadOnlyDictionary` | The local values of the entity. | ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Initializes a new instance of the [DataModificationItem](/restier/api-reference/Microsoft/Restier/Core/Submit/DataModificationItem) class. #### Syntax ```csharp theme={"dark"} public DataModificationItem(string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.RestierEntitySetOperation action, System.Collections.Generic.IReadOnlyDictionary resourceKey, System.Collections.Generic.IReadOnlyDictionary originalValues, System.Collections.Generic.IReadOnlyDictionary localValues) ``` #### Parameters | Name | Type | Description | | - | - | - | | `resourceSetName` | `string` | The name of the resource set in question. | | `expectedResourceType` | `System.Type` | The type of the expected resource type in question. | | `actualResourceType` | `System.Type` | The type of the actual resource type in question. | | `action` | `Microsoft.Restier.Core.RestierEntitySetOperation` | The RestierEntitySetOperations for the request. | | `resourceKey` | `System.Collections.Generic.IReadOnlyDictionary` | The key of the resource being modified. | | `originalValues` | `System.Collections.Generic.IReadOnlyDictionary` | Any original values of the resource that are known. | | `localValues` | `System.Collections.Generic.IReadOnlyDictionary` | The local values of the resource. | ### .ctor Inherited Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem` #### Syntax ```csharp theme={"dark"} internal ChangeSetItem(Microsoft.Restier.Core.Submit.ChangeSetItemType type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `Microsoft.Restier.Core.Submit.ChangeSetItemType` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### ActualResourceType Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets the name of the actual resource type in question. In type inheritance case, this is different from expectedResourceType #### Syntax ```csharp theme={"dark"} public System.Type ActualResourceType { get; private set; } ``` #### Property Value Type: `System.Type` ### ChangeSetItemProcessingStage Inherited Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem` Gets or sets the dynamic state of this change set item. #### Syntax ```csharp theme={"dark"} internal Microsoft.Restier.Core.Submit.ChangeSetItemProcessingStage ChangeSetItemProcessingStage { get; set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Submit.ChangeSetItemProcessingStage` ### EntitySetOperation Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets or sets the action to be taken. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.RestierEntitySetOperation EntitySetOperation { get; set; } ``` #### Property Value Type: `Microsoft.Restier.Core.RestierEntitySetOperation` ### ExpectedResourceType Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets the name of the expected resource type in question. #### Syntax ```csharp theme={"dark"} public System.Type ExpectedResourceType { get; private set; } ``` #### Property Value Type: `System.Type` ### IsFullReplaceUpdateRequest Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets or sets a value indicating whether the resource should be fully replaced by the modification. #### Syntax ```csharp theme={"dark"} public bool IsFullReplaceUpdateRequest { get; set; } ``` #### Property Value Type: `bool` #### Remarks If true, all properties will be updated, even if the property isn't in LocalValues. If false, only properties identified in LocalValues will be updated on the resource. ### LocalValues Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets the local values for properties that have changed. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyDictionary LocalValues { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyDictionary` #### Remarks For entities pending deletion, this property is `null`. ### OriginalValues Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets the original values for properties that have changed. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyDictionary OriginalValues { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyDictionary` #### Remarks For new entities, this property is `null`. ### Resource Gets or sets the resource object in question. #### Syntax ```csharp theme={"dark"} public T Resource { get; set; } ``` #### Property Value Type: `T` #### Remarks Initially this will be `null`, however after the change set has been prepared it will represent the pending resource. ### Resource Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets or sets the resource object in question. #### Syntax ```csharp theme={"dark"} public object Resource { get; set; } ``` #### Property Value Type: `object` #### Remarks Initially this will be `null`, however after the change set has been prepared it will represent the pending resource. ### ResourceKey Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets the key of the resource being modified. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyDictionary ResourceKey { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyDictionary` ### ResourceSetName Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets the name of the resource set in question. #### Syntax ```csharp theme={"dark"} public string ResourceSetName { get; private set; } ``` #### Property Value Type: `string` ### ServerValues Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Gets the current server values for properties that have changed. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyDictionary ServerValues { get; private set; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyDictionary` #### Remarks For new entities, this property is `null`. For updated entities, it is `null` until the change set is prepared. ### Type Inherited Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem` Gets the type of this change set item. #### Syntax ```csharp theme={"dark"} internal Microsoft.Restier.Core.Submit.ChangeSetItemType Type { get; private set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Submit.ChangeSetItemType` ## Methods ### ApplyTo Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Applies the current DataModificationItem's KeyValues and OriginalValues to the specified query and returns the new query. #### Syntax ```csharp theme={"dark"} public System.Linq.IQueryable ApplyTo(System.Linq.IQueryable query) ``` #### Parameters | Name | Type | Description | | - | - | - | | `query` | `System.Linq.IQueryable` | The IQueryable to apply the property values to. | #### Returns Type: `System.Linq.IQueryable` The new IQueryable with the property values applied to it in a Where condition. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### HasChanged Inherited Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem` Indicates whether this change set item is in a changed state. #### Syntax ```csharp theme={"dark"} public bool HasChanged() ``` #### Returns Type: `bool` Whether this change set item is in a changed state. ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ### ValidateEtag Inherited Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem` Validate the e-tag via applies the current DataModificationItem's OriginalValues to the specified query and returns result. #### Syntax ```csharp theme={"dark"} public object ValidateEtag(System.Linq.IQueryable query) ``` #### Parameters | Name | Type | Description | | - | - | - | | `query` | `System.Linq.IQueryable` | The IQueryable to apply the property values to. | #### Returns Type: `object` The object is e-tag checked passed. # DefaultChangeSetInitializer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/DefaultChangeSetInitializer Provides a default implementation of the [IChangeSetInitializer](/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetInitializer) interface. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.DefaultChangeSetInitializer ``` ## Summary Provides a default implementation of the [IChangeSetInitializer](/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetInitializer) interface. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DefaultChangeSetInitializer() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### InitializeAsync Virtual #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task InitializeAsync(Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Restier.Core.Submit.IChangeSetInitializer # DefaultSubmitExecutor Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/DefaultSubmitExecutor Default implementation of [ISubmitExecutor](/restier/api-reference/Microsoft/Restier/Core/Submit/ISubmitExecutor). ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.DefaultSubmitExecutor ``` ## Summary Default implementation of [ISubmitExecutor](/restier/api-reference/Microsoft/Restier/Core/Submit/ISubmitExecutor). ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public DefaultSubmitExecutor() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ExecuteSubmitAsync Virtual #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task ExecuteSubmitAsync(Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Restier.Core.Submit.ISubmitExecutor # IChangeSetInitializer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetInitializer Represents a service that can initialize a change set. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.IChangeSetInitializer ``` ## Summary Represents a service that can initialize a change set. ## Methods ### InitializeAsync Abstract Asynchronously initialize a change set for submission. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task InitializeAsync(Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. #### Remarks Preparing a change set involves creating new entity objects for new data, loading entities that are pending update or delete from to get current server values, and using a data provider mechanism to locally apply the supplied changes to the loaded entities. # IChangeSetItemAuthorizer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetItemAuthorizer Represents a change set item authorizer. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.IChangeSetItemAuthorizer ``` ## Summary Represents a change set item authorizer. ## Methods ### AuthorizeAsync Abstract Asynchronously authorizes the ChangeSetItem. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task AuthorizeAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context. | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | A change set item to be authorized. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. # IChangeSetItemFilter Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetItemFilter Represents a change set item filter to have logic before and after change set item processed. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.IChangeSetItemFilter ``` ## Summary Represents a change set item filter to have logic before and after change set item processed. ## Methods ### OnChangeSetItemProcessedAsync Abstract Asynchronously applies logic after a change set item is processed. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task OnChangeSetItemProcessedAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context. | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | A change set item. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. ### OnChangeSetItemProcessingAsync Abstract Asynchronously applies logic before a change set item is processed. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task OnChangeSetItemProcessingAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context. | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | A change set item. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. # IChangeSetItemValidator Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetItemValidator Represents a change set entry validator. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.IChangeSetItemValidator ``` ## Summary Represents a change set entry validator. ## Methods ### ValidateChangeSetItemAsync Abstract Asynchronously validates a change set item. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ValidateChangeSetItemAsync(Microsoft.Restier.Core.Submit.SubmitContext context, Microsoft.Restier.Core.Submit.ChangeSetItem item, System.Collections.ObjectModel.Collection validationResults, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context. | | `item` | `Microsoft.Restier.Core.Submit.ChangeSetItem` | The change set item to validate. | | `validationResults` | `System.Collections.ObjectModel.Collection` | A set of validation results. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation. # ISubmitExecutor Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/ISubmitExecutor Represents a service that executes a submission. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.ISubmitExecutor ``` ## Summary Represents a service that executes a submission. ## Methods ### ExecuteSubmitAsync Abstract Asynchronously executes a submission and produces a submit result. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task ExecuteSubmitAsync(Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context. | | `cancellationToken` | `System.Threading.CancellationToken` | A cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` A task that represents the asynchronous operation whose result is a submit result. # SubmitContext Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/SubmitContext Represents context under which a submit flow operates. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** Microsoft.Restier.Core.InvocationContext ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.SubmitContext ``` ## Summary Represents context under which a submit flow operates. ## Constructors ### .ctor Initializes a new instance of the [SubmitContext](/restier/api-reference/Microsoft/Restier/Core/Submit/SubmitContext) class. #### Syntax ```csharp theme={"dark"} public SubmitContext(Microsoft.Restier.Core.ApiBase api, Microsoft.Restier.Core.Submit.ChangeSet changeSet) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | | `changeSet` | `Microsoft.Restier.Core.Submit.ChangeSet` | A change set. | ### .ctor Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Initializes a new instance of the [InvocationContext](/restier/api-reference/Microsoft/Restier/Core/InvocationContext) class. #### Syntax ```csharp theme={"dark"} public InvocationContext(Microsoft.Restier.Core.ApiBase api) ``` #### Parameters | Name | Type | Description | | - | - | - | | `api` | `Microsoft.Restier.Core.ApiBase` | An Api. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Api Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets the [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) descendant for this invocation. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.ApiBase Api { get; } ``` #### Property Value Type: `Microsoft.Restier.Core.ApiBase` ### ChangeSet Gets or sets the change set. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Submit.ChangeSet ChangeSet { get; set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Submit.ChangeSet` #### Remarks The change set cannot be set if there is already a result. ### Result Gets or sets the submit result. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Submit.SubmitResult Result { get; set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Submit.SubmitResult` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public T GetApiService() where T : class ``` #### Returns Type: `T` The API service instance. #### Type Parameters * `T` - The API service type. ### GetApiService Inherited Inherited from `Microsoft.Restier.Core.InvocationContext` Gets an API service. #### Syntax ```csharp theme={"dark"} public object GetApiService(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The API service type. | #### Returns Type: `object` The API service instance. ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SubmitResult Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/SubmitResult Represents a submit result. ## Definition **Assembly:** Microsoft.Restier.Core.dll **Namespace:** Microsoft.Restier.Core.Submit **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} Microsoft.Restier.Core.Submit.SubmitResult ``` ## Summary Represents a submit result. ## Constructors ### .ctor Initializes a new instance of the [SubmitResult](/restier/api-reference/Microsoft/Restier/Core/Submit/SubmitResult) class with an error. #### Syntax ```csharp theme={"dark"} public SubmitResult(System.Exception exception) ``` #### Parameters | Name | Type | Description | | - | - | - | | `exception` | `System.Exception` | An error. | ### .ctor Initializes a new instance of the [SubmitResult](/restier/api-reference/Microsoft/Restier/Core/Submit/SubmitResult) class #### Syntax ```csharp theme={"dark"} public SubmitResult(Microsoft.Restier.Core.Submit.ChangeSet completedChangeSet) ``` #### Parameters | Name | Type | Description | | - | - | - | | `completedChangeSet` | `Microsoft.Restier.Core.Submit.ChangeSet` | A completed change set. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CompletedChangeSet Gets or sets the completed change set. #### Syntax ```csharp theme={"dark"} public Microsoft.Restier.Core.Submit.ChangeSet CompletedChangeSet { get; set; } ``` #### Property Value Type: `Microsoft.Restier.Core.Submit.ChangeSet` #### Remarks Setting this value will override any existing error or completed change set. ### Exception Gets or sets an error to be returned. #### Syntax ```csharp theme={"dark"} public System.Exception Exception { get; set; } ``` #### Property Value Type: `System.Exception` #### Remarks Setting this value will override any existing error or completed change set. ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/Submit/index Summary of the Microsoft.Restier.Core.Submit Namespace ## Types ### Classes | Name | Summary | | - | - | | [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet) | Represents a change set. | | [ChangeSetItem](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSetItem) | Represents an item in a change set. | | [DataModificationItem](/restier/api-reference/Microsoft/Restier/Core/Submit/DataModificationItem) | Represents a data modification item in a change set. | | [DataModificationItem](/restier/api-reference/Microsoft/Restier/Core/Submit/DataModificationItem) | Represents a data modification item in a change set. | | [ChangeSetItemValidationResult](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSetItemValidationResult) | Represents a single result when validating an entity, property, etc. | | [DefaultChangeSetInitializer](/restier/api-reference/Microsoft/Restier/Core/Submit/DefaultChangeSetInitializer) | Provides a default implementation of the [IChangeSetInitializer](/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetInitializer) interface. | | [DefaultSubmitExecutor](/restier/api-reference/Microsoft/Restier/Core/Submit/DefaultSubmitExecutor) | Default implementation of [ISubmitExecutor](/restier/api-reference/Microsoft/Restier/Core/Submit/ISubmitExecutor). | | [SubmitContext](/restier/api-reference/Microsoft/Restier/Core/Submit/SubmitContext) | Represents context under which a submit flow operates. | | [SubmitResult](/restier/api-reference/Microsoft/Restier/Core/Submit/SubmitResult) | Represents a submit result. | ### Interfaces | Name | Summary | | - | - | | [IChangeSetInitializer](/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetInitializer) | Represents a service that can initialize a change set. | | [IChangeSetItemAuthorizer](/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetItemAuthorizer) | Represents a change set item authorizer. | | [IChangeSetItemFilter](/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetItemFilter) | Represents a change set item filter to have logic before and after change set item processed. | | [IChangeSetItemValidator](/restier/api-reference/Microsoft/Restier/Core/Submit/IChangeSetItemValidator) | Represents a change set entry validator. | | [ISubmitExecutor](/restier/api-reference/Microsoft/Restier/Core/Submit/ISubmitExecutor) | Represents a service that executes a submission. | # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/Core/index Summary of the Microsoft.Restier.Core Namespace ## Types ### Classes | Name | Summary | | - | - | | [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) | Represents a base class for an API. | | [ConventionBasedChangeSetItemAuthorizer](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemAuthorizer) | A convention-based change set item authorizer. | | [ConventionBasedChangeSetItemFilter](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemFilter) | A convention-based change set item processor which calls logic like OnInserting and OnInserted. | | [ConventionBasedChangeSetItemValidator](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedChangeSetItemValidator) | A convention-based change set item validator. | | [ConventionBasedMethodNameFactory](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedMethodNameFactory) | A set of string factory methods than generate Restier names for various possible operations. | | [ConventionBasedOperationAuthorizer](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedOperationAuthorizer) | A convention-based operation authorizer. | | [ConventionBasedOperationFilter](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedOperationFilter) | A convention-based change set item filter. | | [ConventionBasedQueryExpressionProcessor](/restier/api-reference/Microsoft/Restier/Core/ConventionBasedQueryExpressionProcessor) | A convention-based query expression processor which will apply OnFilter logic into query expression. | | [DataSourceStub](/restier/api-reference/Microsoft/Restier/Core/DataSourceStub) | Represents method stubs that identify API data source. | | [RestierEntitySetOperation](/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation) | Represents the Restier operations available to an EntitySet. | | [RestierOperationMethod](/restier/api-reference/Microsoft/Restier/Core/RestierOperationMethod) | Represents the Restier operations available to an [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport). | | [RestierPipelineState](/restier/api-reference/Microsoft/Restier/Core/RestierPipelineState) | Represents the different parts of the Restier request execution pipeline. | | [ChangeSetValidationException](/restier/api-reference/Microsoft/Restier/Core/ChangeSetValidationException) | Represents an exception that indicates validation errors occurred on entities. | | [ConventionInvocationException](/restier/api-reference/Microsoft/Restier/Core/ConventionInvocationException) | Represents an exception that indicates validation errors occurred on entities. | | [EdmModelValidationException](/restier/api-reference/Microsoft/Restier/Core/EdmModelValidationException) | Represents an exception that indicates validation errors occurred on entities. | | [StatusCodeException](/restier/api-reference/Microsoft/Restier/Core/StatusCodeException) | Use this exception when you want to return a specific status code | | [InvocationContext](/restier/api-reference/Microsoft/Restier/Core/InvocationContext) | Represents context under which an request is processed. The request could be a query, a submit, an operation execution or a model retrieve. It has subclass for each kinds of request. | | [RestierApiBuilder](/restier/api-reference/Microsoft/Restier/Core/RestierApiBuilder) | A fluent configuration helper that registers [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instances and tracks the additional Dependency Injection services those APIs need. | | [RestierContainerBuilder](/restier/api-reference/Microsoft/Restier/Core/RestierContainerBuilder) | The default Dependency Injection container builder for Restier. | | [RestierRouteBuilder](/restier/api-reference/Microsoft/Restier/Core/RestierRouteBuilder) | A fluent configuration helper that maps [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) instances to ASP.NET OData routes. | ### Enums | Name | Summary | | - | - | | [RestierEntitySetOperation](/restier/api-reference/Microsoft/Restier/Core/RestierEntitySetOperation) | Represents the Restier operations available to an EntitySet. | | [RestierOperationMethod](/restier/api-reference/Microsoft/Restier/Core/RestierOperationMethod) | Represents the Restier operations available to an [IEdmOperationImport](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmoperationimport). | | [RestierPipelineState](/restier/api-reference/Microsoft/Restier/Core/RestierPipelineState) | Represents the different parts of the Restier request execution pipeline. | # EFChangeSetInitializer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFramework/EFChangeSetInitializer To prepare changed entries for the given [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). ## Definition **Assembly:** Microsoft.Restier.EntityFramework.dll **Namespace:** Microsoft.Restier.EntityFramework **Inheritance:** Microsoft.Restier.Core.Submit.DefaultChangeSetInitializer ## Syntax ```csharp theme={"dark"} Microsoft.Restier.EntityFramework.EFChangeSetInitializer ``` ## Summary To prepare changed entries for the given [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EFChangeSetInitializer() ``` ## Methods ### ConvertToEfValue Virtual Convert a Edm type value to Resource Framework supported value type #### Syntax ```csharp theme={"dark"} public virtual object ConvertToEfValue(System.Type type, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The type of the property defined in CLR class | | `value` | `object` | The value from OData deserializer and in type of Edm | #### Returns Type: `object` The converted value object ### InitializeAsync Override Asynchronously prepare the [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task InitializeAsync(Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context class used for preparation. | | `cancellationToken` | `System.Threading.CancellationToken` | The cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` The task object that represents this asynchronous operation. # EntityFrameworkApi Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFramework/EntityFrameworkApi Represents an API over a DbContext. ## Definition **Assembly:** Microsoft.Restier.EntityFramework.dll **Namespace:** Microsoft.Restier.EntityFramework **Inheritance:** Microsoft.Restier.Core.ApiBase ## Syntax ```csharp theme={"dark"} Microsoft.Restier.EntityFramework.EntityFrameworkApi ``` ## Summary Represents an API over a DbContext. ## Remarks This class tries to instantiate *T* with the best matched constructor base on services configured. Descendants could override by registering *T* as a scoped service. But in this case, proxy creation must be disabled in the constructors of *T* under Entity Framework 6. ## Type Parameters * `T` - The DbContext type. ## Constructors ### .ctor Initializes a new instance of the [EntityFrameworkApi\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.entityframework.entityframeworkapi-1) class. #### Syntax ```csharp theme={"dark"} public EntityFrameworkApi(System.IServiceProvider serviceProvider) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceProvider` | `System.IServiceProvider` | An [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) containing all services of this [EntityFrameworkApi\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.entityframework.entityframeworkapi-1). | ## Properties ### ContextType Gets the Context Type. #### Syntax ```csharp theme={"dark"} public System.Type ContextType { get; } ``` #### Property Value Type: `System.Type` ### DbContext Gets the underlying DbContext for this API. #### Syntax ```csharp theme={"dark"} public T DbContext { get; } ``` #### Property Value Type: `T` ## Related APIs * Microsoft.Restier.EntityFramework.IEntityFrameworkApi # IEntityFrameworkApi Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFramework/IEntityFrameworkApi Interface for Entity Framework Api instances. Makes easy retrieval of the DbContext possible. ## Definition **Assembly:** Microsoft.Restier.EntityFramework.dll **Namespace:** Microsoft.Restier.EntityFramework ## Syntax ```csharp theme={"dark"} Microsoft.Restier.EntityFramework.IEntityFrameworkApi ``` ## Summary Interface for Entity Framework Api instances. Makes easy retrieval of the DbContext possible. ## Properties ### ContextType Abstract Gets the Context Type. #### Syntax ```csharp theme={"dark"} System.Type ContextType { get; } ``` #### Property Value Type: `System.Type` ### DbContext Abstract Gets the underlying DbContext for this API. #### Syntax ```csharp theme={"dark"} System.Data.Entity.DbContext DbContext { get; } ``` #### Property Value Type: `System.Data.Entity.DbContext` # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFramework/index Summary of the Microsoft.Restier.EntityFramework Namespace ## Types ### Classes | Name | Summary | | - | - | | [EFChangeSetInitializer](/restier/api-reference/Microsoft/Restier/EntityFramework/EFChangeSetInitializer) | To prepare changed entries for the given [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). | | [EntityFrameworkApi](/restier/api-reference/Microsoft/Restier/EntityFramework/EntityFrameworkApi) | Represents an API over a DbContext. | ### Interfaces | Name | Summary | | - | - | | [IEntityFrameworkApi](/restier/api-reference/Microsoft/Restier/EntityFramework/IEntityFrameworkApi) | Interface for Entity Framework Api instances. Makes easy retrieval of the DbContext possible. | # EFChangeSetInitializer Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFrameworkCore/EFChangeSetInitializer To prepare changed entries for the given [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). ## Definition **Assembly:** Microsoft.Restier.EntityFrameworkCore.dll **Namespace:** Microsoft.Restier.EntityFrameworkCore **Inheritance:** Microsoft.Restier.Core.Submit.DefaultChangeSetInitializer ## Syntax ```csharp theme={"dark"} Microsoft.Restier.EntityFrameworkCore.EFChangeSetInitializer ``` ## Summary To prepare changed entries for the given [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public EFChangeSetInitializer() ``` ## Methods ### ConvertToEfValue Virtual Convert a Edm type value to Resource Framework supported value type. #### Syntax ```csharp theme={"dark"} public virtual object ConvertToEfValue(System.Type type, object value) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | The type of the property defined in CLR class. | | `value` | `object` | The value from OData deserializer and in type of Edm. | #### Returns Type: `object` The converted value object. ### InitializeAsync Override Asynchronously prepare the [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). #### Syntax ```csharp theme={"dark"} public override System.Threading.Tasks.Task InitializeAsync(Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `Microsoft.Restier.Core.Submit.SubmitContext` | The submit context class used for preparation. | | `cancellationToken` | `System.Threading.CancellationToken` | The cancellation token. | #### Returns Type: `System.Threading.Tasks.Task` The task object that represents this asynchronous operation. # EntityFrameworkApi Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFrameworkCore/EntityFrameworkApi Represents an API over a DbContext. ## Definition **Assembly:** Microsoft.Restier.EntityFrameworkCore.dll **Namespace:** Microsoft.Restier.EntityFrameworkCore **Inheritance:** Microsoft.Restier.Core.ApiBase ## Syntax ```csharp theme={"dark"} Microsoft.Restier.EntityFrameworkCore.EntityFrameworkApi ``` ## Summary Represents an API over a DbContext. ## Remarks This class tries to instantiate *T* with the best matched constructor base on services configured. Descendants could override by registering *T* as a scoped service. But in this case, proxy creation must be disabled in the constructors of *T* under Entity Framework 6. ## Type Parameters * `T` - The DbContext type. ## Constructors ### .ctor Initializes a new instance of the [EntityFrameworkApi\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.entityframeworkcore.entityframeworkapi-1) class. #### Syntax ```csharp theme={"dark"} public EntityFrameworkApi(System.IServiceProvider serviceProvider) ``` #### Parameters | Name | Type | Description | | - | - | - | | `serviceProvider` | `System.IServiceProvider` | An [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) containing all services of this [EntityFrameworkApi\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.entityframeworkcore.entityframeworkapi-1). | ## Properties ### ContextType Gets the Context Type. #### Syntax ```csharp theme={"dark"} public System.Type ContextType { get; } ``` #### Property Value Type: `System.Type` ### DbContext Gets the underlying DbContext for this API. #### Syntax ```csharp theme={"dark"} public T DbContext { get; } ``` #### Property Value Type: `T` ## Related APIs * Microsoft.Restier.EntityFrameworkCore.IEntityFrameworkApi # IEntityFrameworkApi Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFrameworkCore/IEntityFrameworkApi Interface for Entity Framework Api instances. Makes easy retrieval of the DbContext possible. ## Definition **Assembly:** Microsoft.Restier.EntityFrameworkCore.dll **Namespace:** Microsoft.Restier.EntityFrameworkCore ## Syntax ```csharp theme={"dark"} Microsoft.Restier.EntityFrameworkCore.IEntityFrameworkApi ``` ## Summary Interface for Entity Framework Api instances. Makes easy retrieval of the DbContext possible. ## Properties ### ContextType Abstract Gets the Context Type. #### Syntax ```csharp theme={"dark"} System.Type ContextType { get; } ``` #### Property Value Type: `System.Type` ### DbContext Abstract Gets the underlying DbContext for this API. #### Syntax ```csharp theme={"dark"} Microsoft.EntityFrameworkCore.DbContext DbContext { get; } ``` #### Property Value Type: `Microsoft.EntityFrameworkCore.DbContext` # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Restier/EntityFrameworkCore/index Summary of the Microsoft.Restier.EntityFrameworkCore Namespace ## Types ### Classes | Name | Summary | | - | - | | [EFChangeSetInitializer](/restier/api-reference/Microsoft/Restier/EntityFrameworkCore/EFChangeSetInitializer) | To prepare changed entries for the given [ChangeSet](/restier/api-reference/Microsoft/Restier/Core/Submit/ChangeSet). | | [EntityFrameworkApi](/restier/api-reference/Microsoft/Restier/EntityFrameworkCore/EntityFrameworkApi) | Represents an API over a DbContext. | ### Interfaces | Name | Summary | | - | - | | [IEntityFrameworkApi](/restier/api-reference/Microsoft/Restier/EntityFrameworkCore/IEntityFrameworkApi) | Interface for Entity Framework Api instances. Makes easy retrieval of the DbContext possible. | # GeographyLineString Source: https://easyaf.dev/restier/api-reference/Microsoft/Spatial/GeographyLineString Extension methods for GeographyLineString from Microsoft.Spatial ## Definition **Assembly:** Microsoft.Spatial.dll **Namespace:** Microsoft.Spatial ## Syntax ```csharp theme={"dark"} Microsoft.Spatial.GeographyLineString ``` ## Summary This type is defined in Microsoft.Spatial. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.spatial.geographylinestring) for more information about the rest of the API. ## Methods ### ToDbGeography Extension Extension method from `Microsoft.Restier.EntityFramework.GeographyConverter` Convert a Edm GeographyLineString to DbGeography #### Syntax ```csharp theme={"dark"} public static System.Data.Entity.Spatial.DbGeography ToDbGeography(Microsoft.Spatial.GeographyLineString lineString) ``` #### Parameters | Name | Type | Description | | - | - | - | | `lineString` | `Microsoft.Spatial.GeographyLineString` | The Edm GeographyLineString to be converted | #### Returns Type: `System.Data.Entity.Spatial.DbGeography` A DbGeography # GeographyPoint Source: https://easyaf.dev/restier/api-reference/Microsoft/Spatial/GeographyPoint Extension methods for GeographyPoint from Microsoft.Spatial ## Definition **Assembly:** Microsoft.Spatial.dll **Namespace:** Microsoft.Spatial ## Syntax ```csharp theme={"dark"} Microsoft.Spatial.GeographyPoint ``` ## Summary This type is defined in Microsoft.Spatial. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.spatial.geographypoint) for more information about the rest of the API. ## Methods ### ToDbGeography Extension Extension method from `Microsoft.Restier.EntityFramework.GeographyConverter` Convert a Edm GeographyPoint to DbGeography #### Syntax ```csharp theme={"dark"} public static System.Data.Entity.Spatial.DbGeography ToDbGeography(Microsoft.Spatial.GeographyPoint point) ``` #### Parameters | Name | Type | Description | | - | - | - | | `point` | `Microsoft.Spatial.GeographyPoint` | The Edm GeographyPoint to be converted | #### Returns Type: `System.Data.Entity.Spatial.DbGeography` A DbGeography # Overview Source: https://easyaf.dev/restier/api-reference/Microsoft/Spatial/index Summary of the Microsoft.Spatial Namespace ## Types # DbGeography Source: https://easyaf.dev/restier/api-reference/System/Data/Entity/Spatial/DbGeography Extension methods for DbGeography from EntityFramework ## Definition **Assembly:** EntityFramework.dll **Namespace:** System.Data.Entity.Spatial ## Syntax ```csharp theme={"dark"} System.Data.Entity.Spatial.DbGeography ``` ## Summary This type is defined in EntityFramework. ## Methods ### ToGeographyLineString Extension Extension method from `Microsoft.Restier.EntityFramework.GeographyConverter` Convert a DbGeography to Edm GeographyPoint #### Syntax ```csharp theme={"dark"} public static Microsoft.Spatial.GeographyLineString ToGeographyLineString(System.Data.Entity.Spatial.DbGeography geography) ``` #### Parameters | Name | Type | Description | | - | - | - | | `geography` | `System.Data.Entity.Spatial.DbGeography` | The DbGeography to be converted | #### Returns Type: `Microsoft.Spatial.GeographyLineString` A Edm GeographyLineString ### ToGeographyPoint Extension Extension method from `Microsoft.Restier.EntityFramework.GeographyConverter` Convert a DbGeography to Edm GeographyPoint #### Syntax ```csharp theme={"dark"} public static Microsoft.Spatial.GeographyPoint ToGeographyPoint(System.Data.Entity.Spatial.DbGeography geography) ``` #### Parameters | Name | Type | Description | | - | - | - | | `geography` | `System.Data.Entity.Spatial.DbGeography` | The DbGeography to be converted | #### Returns Type: `Microsoft.Spatial.GeographyPoint` A Edm GeographyPoint # Overview Source: https://easyaf.dev/restier/api-reference/System/Data/Entity/Spatial/index Summary of the System.Data.Entity.Spatial Namespace ## Types # Contribution Guidelines Source: https://easyaf.dev/restier/contribution-guidelines Learn how to contribute to the Restier project # How Can I Contribute? There are many ways for you to contribute to RESTier. The easiest way is to participate in discussion of features and issues. You can also contribute by sending pull requests of features or bug fixes to us. Contribution to the [documentation](http://odata.github.io/RESTier/) is also highly welcomed. Participate in discussions and ask questions about RESTier at our [GitHub issues](https://github.com/OData/RESTier/issues). Report bugs using the issue template. Issues related to other libraries should be reported to their respective trackers. Submit pull requests for features, bug fixes, and documentation improvements. ## Discussion You can participate in discussions and ask questions about RESTier at our [GitHub issues](https://github.com/OData/RESTier/issues). ## Bug Reports When reporting a bug at the issue tracker, fill the template of the issue. Issues related to other libraries should not be reported in RESTier library issue tracker, but be reported to other libraries' issue tracker. ## Pull Requests **Pull request is the only way we accept code and document contribution.** Pull requests for documentation, features, and bug fixes are all welcomed. Refer to this [link](https://help.github.com/articles/using-pull-requests/) to learn details about pull requests. Before you send a pull request to us, you need to make sure you've followed the steps listed below. ### Pick an issue to work on You should either create or pick an issue on the [issue tracker](https://github.com/OData/RESTier/issues) before you work on the pull request. After the RESTier team has reviewed this issue and changed its label to "accepting pull request", you can work on the code change. ### Prepare Tools * [Atom](https://atom.io/) with package [atom-beautify](https://atom.io/packages/atom-beautify) and [markdown-toc](https://atom.io/packages/markdown-toc) * [MarkdownPad](http://www.markdownpad.com/) * Visual Studio 2015 or later ### Steps to create a pull request These are the recommended steps to create a pull request: Create a forked repository of [https://github.com/OData/RESTier.git](https://github.com/OData/RESTier.git) Clone the forked repository into your local environment Add a git remote to upstream for local repository: ```bash theme={"dark"} git remote add upstream https://github.com/OData/RESTier.git ``` Make code changes and add test cases (refer to Test specification section for more details about tests) Test the changed code with one-click build and test script Commit changed code to local repository with clear message Rebase the code to upstream and resolve conflicts if any: ```bash theme={"dark"} git pull --rebase upstream master # If conflicts exist: git pull --rebase continue ``` Push local commit to the forked repository Create pull request from forked repository Web console via comparing with upstream Complete a Contributor License Agreement (CLA), refer below section for more details Pull request will be reviewed by Microsoft OData team Address comments and revise code if necessary. Commit the changes to local repository or amend existing commit: ```bash theme={"dark"} git commit --amend ``` Rebase the code with upstream again and resolve conflicts if any: ```bash theme={"dark"} git pull --rebase upstream master # If conflicts exist: git pull --rebase continue ``` Test the changed code with one-click build and test script again Push changes to the forked repository (use `--force` option if existing commit is amended) Microsoft OData team will merge the pull request into upstream ### Test specification All tests need to be written with **xUnit**. Here are some rules to follow when you are organizing the test code: Format: `X -> X.Tests` For instance, all the test code of the `Microsoft.Restier.Core` project should be placed in the `Microsoft.Restier.Core.Tests` project. **Path and file name correspondence**: `X/Y/Z/A.cs -> X.Tests/Y/Z/ATests.cs` For example, the test code of the `ConventionBasedApiModelBuilder` class (in the `Microsoft.Restier.Core/Convention/ConventionBasedApiModelBuilder.cs` file) should be placed in the `Microsoft.Restier.Core.Tests/Convention/ConventionBasedApiModelBuilderTests.cs` file. Format: `X.Tests/Y/Z -> X.Tests.Y.Z` The namespace of the file should strictly follow the path. For example, the namespace of the `ConventionBasedApiModelBuilderTests.cs` file should be `Microsoft.Restier.Core.Tests.Convention`. The file for a utility class can be placed at the same level of its user or a shared level that is visible to all its users. But the file name must **NOT** end with `Tests` to avoid any confusion. Those tests usually involve multiple modules and have some specific scenarios. They should be placed separately in `X.Tests/IntegrationTests` and `X.Tests/ScenarioTests`. There is no hard requirement of the folder structure for those tests. But they should be organized logically and systematically as possible. ### Complete a Contribution License Agreement (CLA) You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. Please submit a Contributor License Agreement (CLA) before submitting a pull request: \[Download the Microsoft Contribution License Agreement]\([https://github.com/odata/odatacpp/wiki/files/Microsoft](https://github.com/odata/odatacpp/wiki/files/Microsoft) Contribution License Agreement.pdf) Sign the agreement and scan it Email the signed agreement to [cla@microsoft.com](mailto:cla@microsoft.com) Be sure to include your GitHub username along with the agreement. Only after we have received the signed CLA will we review the pull request that you send. You only need to do this once for contributing to any Microsoft open source projects. # .NET Client Source: https://easyaf.dev/restier/guides/clients/dot-net Consume Restier APIs from .NET Framework applications \[THIS IS A PLACEHOLDER FOR FUTURE CONTENT] # .NET Standard Client Source: https://easyaf.dev/restier/guides/clients/dot-net-standard Consume Restier APIs from .NET Standard and .NET Core applications \[THIS IS A PLACEHOLDER FOR FUTURE CONTENT] # TypeScript Client Source: https://easyaf.dev/restier/guides/clients/typescript Consume Restier APIs from TypeScript and JavaScript applications \[THIS IS A PLACEHOLDER FOR FUTURE CONTENT] # Additional WebAPI Operations Source: https://easyaf.dev/restier/guides/extending-restier/additional-operations Augment your Restier service with custom WebAPI operations ## Additional WebAPI Operations RESTier is built on top of ASP.NET Web API, so like our regular OData support, augmenting your service with additional actions is very simple. First, you must add the action to the EDM Model Builder. Currently RESTier can not route an operation request to a method defined in API class for operation model building, user need to define its own controller with ODataRoute attribute for operation route. Operation includes function (bounded), function import (unbounded), action (bounded), and action(unbounded). For function and action, the ODataRoute attribute must include namespace information. There is a way to simplify the URL to omit the namespace, user can enable this via call "config.EnableUnqualifiedNameCall(true);" during registering. For function import and action import, the ODataRoute attribute must NOT include namespace information. RESTier also supports operation request in batch request, as long as user defines its own controller for operation route. This is an example on how to define customized controller with ODataRoute attribute for operation. ```cs theme={"dark"} using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web.Http; using System.Web.OData; using System.Web.OData.Extensions; using System.Web.OData.Routing; using Microsoft.OData.Edm.Library; using Microsoft.OData.Service.Sample.Trippin.Api; using Microsoft.OData.Service.Sample.Trippin.Models; namespace Microsoft.OData.Service.Sample.Trippin.Controllers { public class TrippinController : ODataController { private TrippinApi Api { get { if (api == null) { api = new TrippinApi(); } return api; } } ... // Unbounded action does not need namespace in route attribute [ODataRoute("ResetDataSource")] public IHttpActionResult ResetDataSource() { // reset the data source; return StatusCode(HttpStatusCode.NoContent); } [ODataRoute("Trips({key})/Microsoft.OData.Service.Sample.Trippin.Models.EndTrip")] public IHttpActionResult EndTrip(int key) { var trip = DbContext.Trips.SingleOrDefault(t => t.TripId == key); return Ok(Api.EndTrip(trip)); } ... } } ``` # In-Memory Data Provider Source: https://easyaf.dev/restier/guides/extending-restier/in-memory-provider Build OData services with all-in-memory resources ## In-Memory Data Provider RESTier supports building an OData service with **all-in-memory** resources. However currently RESTier has not provided a dedicated in-memory provider module so users have to write some service code to bootstrap the initial model with EDM types themselves. There is a sample service with in-memory provider [here](https://github.com/OData/RESTier/tree/apidev/test/ODataEndToEndTests/Microsoft.OData.Service.Sample.TrippinInMemory). This subsection mainly talks about how such a service is created. First please create an **Empty ASP.NET Web API** project following the instructions in [Section 1.2](http://odata.github.io/RESTier/#01-02-Bootstrap). Stop **BEFORE** the **Generate the model classes** part. ### Create the Api class Create a simple data type `Person` with some properties and "fabricate" some fake data. Then add the first entity set `People` to the `Api` class: ```csharp theme={"dark"} using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Web.OData.Builder; using Microsoft.OData.Edm; using Microsoft.Restier.Core; using Microsoft.Restier.Core.Model; namespace Microsoft.OData.Service.Sample.TrippinInMemory { public class TrippinApi : ApiBase { private static readonly List people = new List { ... }; public IQueryable People { get { return people.AsQueryable(); } } } } ``` ### Create an initial model Since the RESTier convention will not produce any EDM type, an initial model with at least the `Person` type needs to be created by service. Here the `ODataConventionModelBuilder` from OData Web API is used for quick model building. Any model building methods supported by Web API OData can be used here, refer to **[Web API OData Model builder](http://odata.github.io/WebApi/#02-01-model-builder-abstract)** document for more information. ```csharp theme={"dark"} namespace Microsoft.OData.Service.Sample.TrippinInMemory { public class TrippinApi : ApiBase { protected override IServiceCollection ConfigureApi(IServiceCollection services) { services.AddService(new ModelBuilder()); return base.ConfigureApi(services); } private class ModelBuilder : IModelBuilder { public Task GetModelAsync(InvocationContext context, CancellationToken cancellationToken) { var builder = new ODataConventionModelBuilder(); builder.EntityType(); return Task.FromResult(builder.GetEdmModel()); } } } } ``` ### Configure the OData endpoint Replace the `WebApiConfig` class with the following code. No need to create a custom controller if users don't have attribute routing. ```csharp theme={"dark"} using System.Web.Http; using Microsoft.Restier.Publisher.OData.Batch; namespace Microsoft.OData.Service.Sample.TrippinInMemory { public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.MapRestierRoute( "TrippinApi", "api/Trippin", new RestierBatchHandler(GlobalConfiguration.DefaultServer)).Wait(); } } } ``` # Temporal Types Source: https://easyaf.dev/restier/guides/extending-restier/temporal-types Working with date and time types in Restier # Temporal Types When using the Microsoft.Restier.Providers.EntityFramework provider, temporal types are now supported. The table below shows how Temporal Types map to SQL Types: | EF Type | SQL Type | Edm Type | Need ColumnAttribute? | | :-: | :-: | :-: | :-: | | System.DateTime | DateTime/DateTime2 | Edm.DateTimeOffset | Y | | System.DateTimeOffset | DateTimeOffset | Edm.DateTimeOffset | N | | System.DateTime | Date | Edm.Date | Y | | System.TimeSpan | Time | Edm.TimeOfDay | Y | | System.TimeSpan | Time | Edm.Duration | N | The next sections illustrate how to use use temporal types in various scenarios. ## Edm.DateTimeOffset Suppose you have an entity class `Person`, all the following code define `Edm.DateTimeOffset` properties in the EDM model though the underlying SQL types are different (see the value of the `TypeName` property). You can see Column attribute is optional here. ```csharp theme={"dark"} using System; using System.ComponentModel.DataAnnotations.Schema; public class Person { public DateTime BirthDateTime1 { get; set; } [Column(TypeName = "DateTime")] public DateTime BirthDateTime2 { get; set; } [Column(TypeName = "DateTime2")] public DateTime BirthDateTime3 { get; set; } public DateTimeOffset BirthDateTime4 { get; set; } } ``` ## Edm.Date The following code define an `Edm.Date` property in the EDM model. ```csharp theme={"dark"} using System; using System.ComponentModel.DataAnnotations.Schema; public class Person { [Column(TypeName = "Date")] public DateTime BirthDate { get; set; } } ``` ## Edm.Duration The following code define an `Edm.Duration` property in the EDM model. ```csharp theme={"dark"} using System; using System.ComponentModel.DataAnnotations.Schema; public class Person { public TimeSpan WorkingHours { get; set; } } ``` ## Edm.TimeOfDay The following code define an `Edm.TimeOfDay` property in the EDM model. Please note that you MUST NOT omit the `ColumnTypeAttribute` on a `TimeSpan` property otherwise it will be recognized as an `Edm.Duration` as described above. ```csharp theme={"dark"} using System; using System.ComponentModel.DataAnnotations.Schema; public class Person { [Column(TypeName = "Time")] public TimeSpan BirthTime { get; set; } } ``` As before, if you have the need to override `ODataPayloadValueConverter`, please now change to override `RestierPayloadValueConverter` instead in order not to break the payload value conversion specialized for these temporal types. # Guides Source: https://easyaf.dev/restier/guides/index The Guides will help you get the most out of Restier. # Restier Guides Comprehensive guides for building, securing, and extending your Restier APIs. ## Server-Side Development Learn how to configure and customize your Restier server. ## Client Integration Connect to Restier APIs from various platforms and languages. ## Extending Restier Advanced topics for extending Restier functionality. # EntitySet Filters Source: https://easyaf.dev/restier/guides/server/filters Control query results by filtering EntitySets based on business rules # EntitySet Filters Have you ever wanted to limit the results of a particular query based on the current user, or maybe you only want to return results that are marked "active"? EntitySet Filters allow you to consistently control the shape of the results returned from particular EntitySets, even across navigation properties. ## Convention-Based Filtering Like the rest of RESTier, this is accomplished through a simple convention that meets the following criteria: The filter method name must be `OnFilter{EntitySetName}`, where `{EntitySetName}` is the name of the target EntitySet. It must be a `protected internal` method on the implementing `EntityFrameworkApi` class. It should accept an `IQueryable` parameter and return an `IQueryable` result where `T` is the Entity type. ### Example ```csharp OnFilterPeople - Filter to users with trips theme={"dark"} /// /// Filters queries to the People EntitySet to only return Users that have Trips. /// protected internal IQueryable OnFilterPeople(IQueryable entitySet) { return entitySet.Where(c => c.Trips.Any()).AsQueryable(); } ``` ```csharp OnFilterTrips - Filter to current user theme={"dark"} /// /// Filters queries to the Trips EntitySet to only return the current user's Trips. /// protected internal IQueryable OnFilterTrips(IQueryable entitySet) { return entitySet.Where(c => c.PersonId == ClaimsPrincipal.Current.FindFirst("currentUserId")).AsQueryable(); } ``` ```csharp TrippinApi.cs - Full example theme={"dark"} using Microsoft.Restier.Core; using Microsoft.Restier.Provider.EntityFramework; using System.Data.Entity; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; namespace Microsoft.OData.Service.Sample.Trippin.Api { /// /// Customizations to the EntityFrameworkApi for the TripPin service. /// /// /// Add the following line in WebApiConfig.cs to register this code: /// await config.MapRestierRoute("Trippin", "api", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); /// public class TrippinApi : EntityFrameworkApi { /// /// Filters queries to the People EntitySet to only return Users that have Trips. /// protected internal IQueryable OnFilterPeople(IQueryable entitySet) { return entitySet.Where(c => c.Trips.Any()).AsQueryable(); } /// /// Filters queries to the Trips EntitySet to only return the current user's Trips. /// protected internal IQueryable OnFilterTrips(IQueryable entitySet) { return entitySet.Where(c => c.PersonId == ClaimsPrincipal.Current.FindFirst("currentUserId")).AsQueryable(); } } } ``` ## Centralized Filtering TODO: Pull content from Section 2.8. # Interceptors Source: https://easyaf.dev/restier/guides/server/interceptors Process validation and business logic before and after database operations # Interceptors Interceptors allow you to process validation and business logic **before** and **after** Entities hit the database. For example, you may need to validate some external business rules before the object is saved, but then after it's saved, you may need to dump the object to an Azure Storage Queue to get picked up by a WebJob for further processing out-of-band. The way RESTier accomplishes this is virtually identical to the [Method Authorization](/restier/server/method-authorization/) feature. This means there are once again two different approaches to tackle the task. No matter what approach you choose, the concept is simple. Either technique uses a function that returns boolean: * Return `true`, and processing continues normally * Return `false`, and RESTier returns a 403 Unauthorized to the client ## Convention-Based Interception Users can control if one of the four submit operations is allowed on some entity set or action by putting some `protected internal` methods into the `Api` class. The method name must conform to the convention: ``` On{BeforeOperation|AfterOperation}{TargetName} ``` The possible values for `{BeforeOperation}` are: * **Inserting** * **Updating** * **Deleting** * **Executing** The possible values for `{AfterOperation}` are: * **Inserted** * **Updated** * **Deleted** * **Executed** The possible values for `{TargetName}` are: * *EntitySetName* * *ActionName* ### Example The example below demonstrates how both types of `{TargetName}` can be used: Shows validation before inserting - checks if the Trip Description is not blank Shows processing after inserting - logs the operation and could trigger additional business processes ```csharp TrippinApi.cs theme={"dark"} using Microsoft.Restier.Providers.EntityFramework; using System; using System.Security.Claims; namespace Microsoft.OData.Service.Sample.Trippin.Api { /// /// Customizations to the EntityFrameworkApi for the TripPin service. /// /// /// Add the following line in WebApiConfig.cs to register this code: /// await config.MapRestierRoute("Trippin", "api", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); /// public class TrippinApi : EntityFrameworkApi { /// /// Specifies whether or not a Trip can be deleted from an EntitySet. /// protected void OnInsertingTrip(Trip trip) { Trace.WriteLine($"{DateTime.Now.ToString()}: {trip.TripId} is being Inserted."); if (string.IsNullOrWhiteSpace(trip.Description)) { throw new ODataException("The Trip Description cannot be blank."); } } /// /// Specifies whether or not a Trip can be deleted from an EntitySet. /// protected void OnInsertedTrip(Trip trip) { Trace.WriteLine($"{DateTime.Now.ToString()}: {trip.tripId} has been Inserted."); // Pseudocode that represents a real business process. // EmailManager.SendTripWelcome(trip); } } } ``` ## Centralized Interception In addition to the more granular convention-based approach, you can also centralize processing into one location. Users can use interface `IChangeSetItemAuthorizer` to define any customized authorize logic to see whether a user is authorized for the specified submit. If this method returns false, then the related query will get error code 403 (Forbidden). There are two steps to plug in the centralized authorization logic: Create a class that implements `IChangeSetItemAuthorizer` Register that class with RESTier through Dependency Injection (DI) ### Example ```csharp CustomAuthorizer.cs theme={"dark"} using Microsoft.OData.Core; using Microsoft.Restier.Providers.EntityFramework; namespace Microsoft.OData.Service.Sample.Trippin.Api { /// /// /// public class CustomAuthorizer : IChangeSetItemAuthorizer { // The inner handler will call CanUpdate/Insert/Delete method private IChangeSetItemProcessor Inner { get; set; } /// /// /// public Task AuthorizeAsync(SubmitContext context, ChangeSetItem item, CancellationToken cancellationToken) { // TODO: RWM: Provide legitimate samples here, along with parameter documentation. } } /// /// Customizations to the EntityFrameworkApi for the TripPin service. /// /// /// Add the following line in WebApiConfig.cs to register this code: /// await config.MapRestierRoute("Trippin", "api", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); /// public class TrippinApi : EntityFrameworkApi { /// /// Allows us to leverage DI to inject additional capabilities into RESTier. /// protected override IServiceCollection ConfigureApi(IServiceCollection services) { return base.ConfigureApi(services) .AddService(); } } } ``` **NEEDS CLARIFICATION:** In CustomizedAuthorizer, user can decide whether to call the RESTier logic. If user decides to call the RESTier logic, user can define a property like `private IChangeSetItemAuthorizer Inner {get; set;}` in class CustomizedAuthorizer, then call `Inner.Inspect()` to call RESTier logic which calls Authorize part logic defined in section 2.3. ## Unit Testing Considerations Because both of these methods are de-coupled from the code that interacts with the database, the Authorization logic is easily testable, without having to fire up the entire Web API + RESTier pipeline. ### Setting up your Unit Test If you don't have a unit test project for your API project already, start by creating one. Repeat the process outlined in "Getting Started" to install the RESTier packages into your Unit Test project. Add the FluentAssertions package to your test project: ```bash theme={"dark"} dotnet add package FluentAssertions ``` Go back to your API project. Expand the "Properties" node, double-click `AssemblyInfo.cs`, and add the following line to the very end of the file: ```csharp theme={"dark"} [assembly: InternalsVisibleTo("{TestProjectAssembly}")] ``` Make sure you replace `{TestProjectAssembly}` with the actual assembly name. This is important, because otherwise the tests won't be able to see the `protected internal` methods the authorization conventions use. ### Example Given the [Convention-Based Authorization](#convention-based-authorization) example, the tests below should have 100% code coverage, and should pass without any required changes. ```csharp TrippinApiTests.cs theme={"dark"} using FluentAssertions; using Microsoft.OData.Core; using Microsoft.OData.Service.Sample.Trippin.Api; using Microsoft.Restier.Providers.EntityFramework; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Security.Claims; namespace Trippin.Tests.Api { /// /// Test cases for the RESTier Method Authorizers. /// [TestClass] public class TrippinApiTests { #region Trips EntitySet /// /// Tests if the Trips EntitySet is properly configured to reject delete requests. /// [TestMethod] public void TrippinApi_Trips_CanDelete_IsConfigured() { var api = new TrippinApi(); api.CanDeleteTrips.Should().BeFalse(); } /// /// Tests if the Trips EntitySet is properly configured to accept Admin update requests. /// [TestMethod] public void TrippinApi_Trips_CanUpdate_IsAdmin() { var api = new TrippinApi(); // We won't be testing HttpContext-related security here, because that requires mocking, // which is outside the scope of this document. AuthenticateAsAdmin(); api.CanUpdateTrips.Should().BeTrue(); } /// /// Tests if the Trips EntitySet is properly configured to reject non-Admin update requests. /// [TestMethod] public void TrippinApi_Trips_CanUpdate_IsNotAdmin() { var api = new TrippinApi(); // We won't be testing HttpContext-related security here, because that requires mocking, // which is outside the scope of this document. AuthenticateAsNonAdmin(); api.CanUpdateTrips.Should().BeFalse(); } #endregion #region Actions /// /// Tests if the Trips EntitySet is properly configured to reject delete requests. /// [TestMethod] public void TrippinApi_CanExecuteResetDataSource_IsConfigured() { var api = new TrippinApi(); api.CanExecuteResetDataSource.Should().BeFalse(); } #endregion #region Test Helpers /// /// Sets the Thread.CurrentPrincipal to a test user with an "admin" Role Claim. /// internal static void AuthenticateAsAdmin() { var claimsCollection = new List { new Claim(ClaimTypes.Role, "admin") }; var claimsIdentity = new ClaimsIdentity(claimsCollection, "Test User"); Thread.CurrentPrincipal = new ClaimsPrincipal(claimsIdentity); } /// /// Sets the Thread.CurrentPrincipal to a test user without an "admin" Role Claim. /// internal static void AuthenticateAsNonAdmin() { var claimsCollection = new List(); var claimsIdentity = new ClaimsIdentity(claimsCollection, "Test User"); Thread.CurrentPrincipal = new ClaimsPrincipal(claimsIdentity); } #endregion } } ``` # Method Authorization Source: https://easyaf.dev/restier/guides/server/method-authorization Fine-grain control over API request execution with security rules # Method Authorization Method Authorization allows you to have fine-grain control over how different types of API requests can be executed. Since most of RESTier uses built-in convention over repetitive boiler-plate Controllers, you can't just add security attributes to the controller methods, like you can with Web API. However, there are two different methods for defining per-request security. One, like the rest of RESTier, is convention-based, and the other executes before every request, allowing you to centralize your authorization logic. This allows you to pick the approach that works best for your architecture. No matter what approach you choose, the concept is simple. Either technique uses a function that returns boolean: * Return `true`, and processing continues normally * Return `false`, and RESTier returns a 403 Unauthorized to the client ## Convention-Based Authorization Users can control if one of the four submit operations is allowed on some EntitySet or Action by putting some `protected internal` methods into the `Api` class. The method name must conform to the convention: ``` Can{Operation}{TargetName} ``` The possible values for `{Operation}` are: * **Insert** * **Update** * **Delete** * **Execute** The possible values for `{TargetName}` are: * *EntitySetName* * *ActionName* ### Example The example below demonstrates how both types of `{TargetName}` can be used: Shows a simple way to prevent **any** user from deleting a particular EntitySet Shows how you can integrate role-based security using multiple techniques Shows how to prevent execution of a custom Action ```csharp TrippinApi.cs theme={"dark"} using Microsoft.Restier.Providers.EntityFramework; using System; using System.Security.Claims; namespace Microsoft.OData.Service.Sample.Trippin.Api { /// /// Customizations to the EntityFrameworkApi for the TripPin service. /// /// /// Add the following line in WebApiConfig.cs to register this code: /// await config.MapRestierRoute("Trippin", "api", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); /// public class TrippinApi : EntityFrameworkApi { /// /// Specifies whether or not a Trip can be deleted from an EntitySet. /// protected internal bool CanDeleteTrips() { return false; } /// /// User role-based security to specifies whether or not a updated Trip can be sent to an EntitySet. /// protected internal bool CanUpdateTrips() { // Use claims-based security return ClaimsPrincipal.Current.IsInRole("admin"); // You can also use legacy role-based security, though it's harder to test. //return HttpContext.Current.User.IsInRole("admin"); } /// /// Specifies whether or not an Action called ResetDataSource can be executed through the API. /// protected internal bool CanExecuteResetDataSource() { return false; } } } ``` ## Centralized Authorization In addition to the more granular convention-based approach, you can also centralize processing into one location. Users can use interface `IChangeSetItemAuthorizer` to define any customized authorize logic to see whether a user is authorized for the specified submit. If this method returns false, then the related query will get error code 403 (Forbidden). There are two steps to plug in the centralized authorization logic: Create a class that implements `IChangeSetItemAuthorizer` Register that class with RESTier through Dependency Injection (DI) ### Example ```csharp CustomAuthorizer.cs theme={"dark"} using Microsoft.OData.Core; using Microsoft.Restier.Providers.EntityFramework; namespace Microsoft.OData.Service.Sample.Trippin.Api { /// /// Provides global ChangeSet Authorization for a RESTier API. /// public class CustomAuthorizer : IChangeSetItemAuthorizer { /// /// /// public Task AuthorizeAsync(SubmitContext context, ChangeSetItem item, CancellationToken cancellationToken) { // TODO: RWM: Provide legitimate samples here, along with parameter documentation. } } /// /// Customizations to the EntityFrameworkApi for the TripPin service. /// /// /// Add the following line in WebApiConfig.cs to register this code: /// await config.MapRestierRoute("Trippin", "api", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); /// public class TrippinApi : EntityFrameworkApi { /// /// Allows us to leverage DI to inject additional capabilities into RESTier. /// protected override IServiceCollection ConfigureApi(IServiceCollection services) { return base.ConfigureApi(services) .AddService(); } } } ``` ## Leveraging Both Techniques There may be certain situations where you want to have a global interceptor, and then pass requests off to the individual convention-based interceptors. For example, if you need to authenticate a Bearer token. The example below shows you exactly how this type of scenario would work. ### Example ```cs theme={"dark"} using Microsoft.OData.Core; using Microsoft.Restier.Providers.EntityFramework; namespace Microsoft.OData.Service.Sample.Trippin.Api { /// /// Provides global ChangeSet Authorization for a RESTier API. /// public class CustomAuthorizer : IChangeSetItemAuthorizer { /// /// The built-in ChangeSetItemAuthorizer instance that will be set by RESTier. /// private IChangeSetItemAuthorizer InnerAuthorizer {get; set;} /// /// /// public Task AuthorizeAsync(SubmitContext context, ChangeSetItem item, CancellationToken cancellationToken) { // TODO: RWM: Provide legitimate samples here, along with parameter documentation. // Hand off processing to the appropriate convention-based function. await InnerAuthorizer.AuthorizeAsync(context, item, cancellationToken); } } /// /// Customizations to the EntityFrameworkApi for the TripPin service. /// /// /// Add the following line in WebApiConfig.cs to register this code: /// await config.MapRestierRoute("Trippin", "api", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); /// public class TrippinApi : EntityFrameworkApi { /// /// Allows us to leverage DI to inject additional capabilities into RESTier. /// protected override IServiceCollection ConfigureApi(IServiceCollection services) { return base.ConfigureApi(services) .AddService(); } } } ``` ## Unit Testing Considerations Because both of these methods are de-coupled from the code that interacts with the database, the Authorization logic is easily testable, without having to fire up the entire Web API + RESTier pipeline. ### Setting up your Unit Test If you don't have a unit test project for your API project already, start by creating one. Repeat the process outlined in "Getting Started" to install the RESTier packages into your Unit Test project. The add the FluentAssertions package. Next, go back to your API project. Expand the "Properties" node, double-click AssemblyInfo.cs, and add the following line to the very end of the file: `[assembly: InternalsVisibleTo("{TestProjectAssembly}")]`, making sure you replace with the actual assembly name. This is important, because otherwise the tests won't be able to see the `protected internal` methods the authorization conventions use. ### Example Given the [Convention-Based Authorization](#convention-based-authorization) example, the tests below should have 100% code coverage, and should pass without any required changes. ```cs theme={"dark"} using FluentAssertions; using Microsoft.OData.Core; using Microsoft.OData.Service.Sample.Trippin.Api; using Microsoft.Restier.Providers.EntityFramework; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Security.Claims; namespace Trippin.Tests.Api { /// /// Test cases for the RESTier Method Authorizers. /// [TestClass] public class TrippinApiTests { #region Trips EntitySet /// /// Tests if the Trips EntitySet is properly configured to reject delete requests. /// [TestMethod] public void TrippinApi_Trips_CanDelete_IsConfigured() { var api = new TrippinApi(); api.CanDeleteTrips.Should().BeFalse(); } /// /// Tests if the Trips EntitySet is properly configured to accept Admin update requests. /// [TestMethod] public void TrippinApi_Trips_CanUpdate_IsAdmin() { var api = new TrippinApi(); // We won't be testing HttpContext-related security here, because that requires mocking, // which is outside the scope of this document. AuthenticateAsAdmin(); api.CanUpdateTrips.Should().BeTrue(); } /// /// Tests if the Trips EntitySet is properly configured to reject non-Admin update requests. /// [TestMethod] public void TrippinApi_Trips_CanUpdate_IsNotAdmin() { var api = new TrippinApi(); // We won't be testing HttpContext-related security here, because that requires mocking, // which is outside the scope of this document. AuthenticateAsNonAdmin(); api.CanUpdateTrips.Should().BeFalse(); } #endregion #region Actions /// /// Tests if the Trips EntitySet is properly configured to reject delete requests. /// [TestMethod] public void TrippinApi_CanExecuteResetDataSource_IsConfigured() { var api = new TrippinApi(); api.CanExecuteResetDataSource.Should().BeFalse(); } #endregion #region Test Helpers /// /// Sets the Thread.CurrentPrincipal to a test user with an "admin" Role Claim. /// internal static void AuthenticateAsAdmin() { var claimsCollection = new List { new Claim(ClaimTypes.Role, "admin") }; var claimsIdentity = new ClaimsIdentity(claimsCollection, "Test User"); Thread.CurrentPrincipal = new ClaimsPrincipal(claimsIdentity); } /// /// Sets the Thread.CurrentPrincipal to a test user without an "admin" Role Claim. /// internal static void AuthenticateAsNonAdmin() { var claimsCollection = new List(); var claimsIdentity = new ClaimsIdentity(claimsCollection, "Test User"); Thread.CurrentPrincipal = new ClaimsPrincipal(claimsIdentity); } #endregion } } ``` # Customizing the Entity Model Source: https://easyaf.dev/restier/guides/server/model-building Customize and extend your Entity Data Model (EDM) in Restier # Customizing the Entity Model OData and the Entity Framework are based on the same underlying concept for mapping the idea of an Entity with its representation in the database. That "mapping" layer is called the Entity Data Model, or EDM for short. Part of the beautiy of RESTier is that, for the majority of API builders, it can construct your EDM for you *automagically*. But there are times where you have to take charge of the process. And as with many things in RESTier, the intrepid developers at Microsoft provide you with two ways to do so. The first method allows you to completely relpace the automagic model construction with your own, in a manner very similar to Web API OData. The second method lets RESTier do the initial work for you, and then you manipulate the resulting EDM metadata. Let's take a look at how each of these methods work. ## ModelBuilder Takeover There are several situations where you are likely going to want to use this approach to create your Model. For example, if you're migrating from an existing Web API OData v3 or v4 implementation, and needed to customize that model, you will be able to copy/paste your existing code over, with just a few small changes. If you're building a new model, but you're using Entity Framework Model First + SQL Views, then you'll likely need to define a primary key, or omit the View from your service. With the Entity Framework provider, the model is built with the [**ODataConventionModelBuilder**](http://odata.github.io/WebApi/#02-04-convention-model-builder). To understand how this ModelBuilder works, please take a few minutes and review that documentation. # Example ```cs theme={"dark"} using Microsoft.Extensions.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.Restier.Core; using Microsoft.Restier.Core.Model; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Web.OData.Builder; namespace Microsoft.OData.Service.Sample.TrippinInMemory { internal class CustomizedModelBuilder : IModelBuilder { public Task GetModelAsync(ModelContext context, CancellationToken cancellationToken) { var builder = new ODataConventionModelBuilder(); builder.EntityType(); return Task.FromResult(builder.GetEdmModel()); } } /// /// /// public class TrippinApi : ApiBase { /// /// /// protected override IServiceCollection ConfigureApi(IServiceCollection services) { return base.ConfigureApi(services) .AddService(); } } } ``` If RESTier entity framework provider is used and user has no additional types other than those in the database schema, no custom model builder or even the `Api` class is required because the provider will take over to build the model instead. But what the provider does behind the scene is similar. ## Extend a model from Api class The `RestierModelExtender` will further extend the EDM model passed in using the public properties and methods defined in the `Api` class. Please note that all properties and methods declared in the parent classes are **NOT** considered. **Entity set** If a property declared in the `Api` class satisfies the following conditions, an entity set whose name is the property name will be added into the model. * Public * Has getter * Either static or instance * There is no existing entity set with the same name * Return type must be `IQueryable` where `T` is class type Example: ```cs theme={"dark"} using System.Collections.Generic; using System.Linq; using Microsoft.Restier.Core.Model; using Microsoft.Restier.Provider.EntityFramework; using Microsoft.OData.Service.Sample.Trippin.Models; namespace Microsoft.OData.Service.Sample.Trippin.Api { public class TrippinApi : EntityFrameworkApi { public IQueryable PeopleWithFriends { get { return Context.People.Include("Friends"); } } ... } } ``` **Singleton** If a property declared in the `Api` class satisfies the following conditions, a singleton whose name is the property name will be added into the model. * Public * Has getter * Either static or instance * There is no existing singleton with the same name * Return type must be non-generic class type Example: ```cs theme={"dark"} using System.Collections.Generic; using System.Linq; using Microsoft.Restier.Core.Model; using Microsoft.Restier.Provider.EntityFramework; using Microsoft.OData.Service.Sample.Trippin.Models; namespace Microsoft.OData.Service.Sample.Trippin.Api { public class TrippinApi : EntityFrameworkApi { ... public Person Me { get { return DbContext.People.Find(1); } } ... } } ``` Due to some limitations from Entity Framework and OData spec, CUD (insertion, update and deletion) on the singleton entity are **NOT** supported directly by RESTier. Users need to define their own route to achieve these operations. **Navigation property binding** Starting from version 0.5.0, the `RestierModelExtender` follows the rules below to add navigation property bindings after entity sets and singletons have been built. * Bindings will **ONLY** be added for those entity sets and singletons that have been built inside `RestierModelExtender`. **Example:** Entity sets built by the RESTier's EF provider are assumed to have their navigation property bindings added already. * The `RestierModelExtender` only searches navigation sources who have the same entity type as the source navigation property. **Example:** If the type of a navigation property is `Person` or `Collection(Person)`, only those entity sets and singletons of type `Person` are searched. * Singleton navigation properties can be bound to either entity sets or singletons. **Example:** If `Person.BestFriend` is a singleton navigation property, bindings from `BestFriend` to an entity set `People` or to a singleton `Boss` are all allowed. * Collection navigation properties can **ONLY** be bound to entity sets. **Example:** If `Person.Friends` is a collection navigation property. **ONLY** binding from `Friends` to an entity set `People` is allowed. Binding from `Friends` to a singleton `Boss` is **NOT** allowed. * If there is any ambiguity among entity sets or singletons, no binding will be added. **Example:** For the singleton navigation property `Person.BestFriend`, no binding will be added if 1) there are at least two entity sets (or singletons) both of type `Person`; 2) there is at least one entity set and one singleton both of type `Person`. However for the collection navigation property `Person.Friends`, no binding will be added only if there are at least two entity sets both of type `Person`. One entity set and one singleton both of type `Person` will **NOT** lead to any ambiguity and one binding to the entity set will be added. If any expected navigation property binding is not added by RESTier, users can always manually add it through custom model extension (mentioned below).
**Operation** If a method declared in the `Api` class satisfies the following conditions, an operation whose name is the method name will be added into the model. * Public * Either static or instance * There is no existing operation with the same name Example (namespace should be specified if the namespace of the method does not match the model): ```cs theme={"dark"} using System.Collections.Generic; using System.Linq; using Microsoft.Restier.Core.Model; using Microsoft.Restier.Provider.EntityFramework; using Microsoft.OData.Service.Sample.Trippin.Models; namespace Microsoft.OData.Service.Sample.Trippin.Api { public class TrippinApi : EntityFrameworkApi { ... // Action import [Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", HasSideEffects = true)] public void CleanUpExpiredTrips() {} // Bound action [Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", HasSideEffects = true)] public Trip EndTrip(Trip bindingParameter) { ... } // Function import [Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", EntitySet = "People")] public IEnumerable GetPeopleWithFriendsAtLeast(int n) { ... } // Bound function [Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", EntitySet = "People")] public Person GetPersonWithMostFriends(IEnumerable bindingParameter) { ... } ... } } ``` Note: 1. Operation attribute's EntitySet property is needed if there are more than one entity set of the entity type that is type of result defined. Take an example if two EntitySet People and AllPersons are defined whose entity type is Person, and the function returns Person or List of Person, then the Operation attribute for function must have EntitySet defined, or EntitySet property is optional. 2. Function and Action uses the same attribute, and if the method is an action, must specify property HasSideEffects with value of true whose default value is false. 3. In order to access an operation user must define an action with `ODataRouteAttribute` in his custom controller. Refer to [section 3.3](http://odata.github.io/RESTier/#03-03-Operation) for more information. ## Custom model extension If users have the need to extend the model even after RESTier's conventions have been applied, user can use IServiceCollection AddService to add a ModelBuilder after calling base.ConfigureApi(services). ```cs theme={"dark"} using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.OData.Edm; using Microsoft.Restier.Core; using Microsoft.Restier.Core.Model; using Microsoft.Restier.Provider.EntityFramework; using Microsoft.OData.Service.Sample.Trippin.Models; namespace Microsoft.OData.Service.Sample.Trippin.Api { public class TrippinAttribute : ApiConfiguratorAttribute { protected override IServiceCollection ConfigureApi(IServiceCollection services) { services = base.ConfigureApi(services); // Add your custom model extender here. services.AddService(); return services; } private class CustomizedModelBuilder : IModelBuilder { public IModelBuilder InnerModelBuilder { get; set; } public async Task GetModelAsync(InvocationContext context, CancellationToken cancellationToken) { IEdmModel model = null; // Call inner model builder to get a model to extend. if (this.InnerModelBuilder != null) { model = await this.InnerModelBuilder.GetModelAsync(context, cancellationToken); } // Do sth to extend the model such as add custom navigation property binding. return model; } } } } ``` After the above steps, the final process of building the model will be: * User's model builder registered before base.ConfigureApi(services) is called first. * RESTier's model builder includes EF model builder and RestierModelExtender will be called. * User's model builder registered after base.ConfigureApi(services) is called.
If InnerModelBuilder method is not called first, then the calling sequence will be different. Actually this order not only applies to the `IModelBuilder` but also all other services. Refer to [section 4.3](http://odata.github.io/RESTier/#04-03-Api-Service) for more details of RESTier API Service. # Microsoft Restier Source: https://easyaf.dev/restier/index OData V4 API development framework for building standardized RESTful services on .NET # Microsoft Restier - OData Made Simple
[Releases](https://github.com/OData/RESTier/releases) | Documentation | [OData v4.01 Documentation](https://www.odata.org/documentation/) [![Build Status](https://img.shields.io/azure-devops/build/cloudnimble/restier/8.svg?style=for-the-badge\&logo=azuredevops)](https://dev.azure.com/cloudnimble/Restier/_build?definitionId=8) [![Release Status](https://img.shields.io/azure-devops/release/cloudnimble/d3aaa016-9aea-4903-b6a6-abda1d4c84f0/1/1.svg?style=for-the-badge\&logo=azuredevops)](https://dev.azure.com/cloudnimble/Restier/_release?view=all\&definitionId=1) [![Nightly Feed](https://img.shields.io/badge/continuous%20integration-feed-0495dc.svg?style=for-the-badge\&logo=nuget\&logoColor=fff)](https://www.myget.org/F/restier-nightly/api/v3/index.json) [![Code of Conduct](https://img.shields.io/badge/code%20of-conduct-00a1f1.svg?style=for-the-badge\&logo=windows)](https://opensource.microsoft.com/codeofconduct/) [![Twitter](https://img.shields.io/badge/share-on%20twitter-55acee.svg?style=for-the-badge\&logo=twitter)](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2FOData%2FRESTier\&via=robertmclaws\&text=Check%20out%20Restier%21%20It%27s%20the%20simple%2C%20queryable%20framework%20for%20building%20data-driven%20APIs%20in%20.NET%21\&hashtags=odata)
## What is Restier? Restier is an API development framework for building standardized, **OData V4 based RESTful services** on .NET. Restier is the spiritual successor to [WCF Data Services](https://en.wikipedia.org/wiki/WCF_Data_Services). Instead of generating endless boilerplate code with the current Web API + OData toolchain, RESTier helps you bootstrap a standardized, queryable HTTP-based REST interface in literally minutes. Like WCF Data Services before it, Restier provides simple and straightforward ways to shape queries and intercept submissions **before** and **after** they hit the database. And like Web API + OData, you still have the flexibility to add your own custom queries and actions with techniques you're already familiar with. ## What is OData? **OData** stands for the Open Data Protocol. OData enables the creation and consumption of RESTful APIs, which allow resources, defined in a data model and identified by using URLs, to be published and edited by Web clients using simple HTTP requests. OData was originally designed by Microsoft to be a framework for exposing Entity Framework objects over REST services. The first concepts shipped as "Project Astoria" in 2007. By 2009, the concept had evolved enough for Microsoft to announce OData, along with a [larger effort](https://blogs.msdn.microsoft.com/odatateam/2009/11/17/breaking-down-data-silos-the-open-data-protocol-odata/) to push the format as an industry standard. Work on the current version of the protocol (V4) began in April 2012, and was ratified by OASIS as an industry standard in February 2014. ## Getting Started Now that the project has restarted, we have a new location for our \[Continuous Integration builds]\[nightly-feed]. We've simplified the NuGet packages as well, so now you can just reference the following packages and we'll take care of the rest: ```bash ASP.NET theme={"dark"} dotnet add package Microsoft.Restier.AspNet ``` ```bash ASP.NET Core theme={"dark"} dotnet add package Microsoft.Restier.AspNetCore ``` ## Use Cases Coming Soon! ## Supported Platforms Restier 1.0 currently ships with support for Classic ASP.NET 5.2.3 and later. Support for ASP.NET Core 2.2 is coming in the first half of 2019. ## Restier Components The Classic ASP.NET flavor of Restier is made up of the following components: * **Microsoft.Restier.AspNet:** Plugs into the OData/WebApi processing pipeline and provides query interception capabilities. * **Microsoft.Restier.Core:** The base library that contains the core convention-based interception framework. * **Microsoft.Restier.EntityFramework:** Translates intercepted queries down to the database level to be executed. The ASP.NET Core flavor of Restier consists of the following: * **Microsoft.Restier.AspNetCore:** Plugs into the OData/WebApi processing pipeline and provides query interception capabilities. * **Microsoft.Restier.Core:** The base library that contains the core convention-based interception framework. * **Microsoft.Restier.EntityFrameworkCore:** Translates intercepted queries down to the database level to be executed. ## Ecosystem Restier is used in production solutions from: * [BurnRate.io](https://burnrate.io) * [CloudNimble, Inc.](https://nimbleapps.cloud) * [Florida Agency for Health Care Administration](https://ahca.myflorida.com) There is also a growing set of tools to support Restier-based development: * [Breakdance.Restier](https://github.com/cloudnimble/breakdance): Convention-based name troubleshooting and integration test support. ## Community After a couple years in stasis, Restier is in active development once again. The project is led by Robert McLaws and Chris Woodruff. ### Weekly Standups The core development team meets once a week on Google Hangouts to discuss pressing items and work through the issues list. A history of those meetings can be found in the Wiki. ### Contributing If you'd like to help out with the project, our Contributor's Handbook is also located in the Wiki. ## Contributors Special thanks to everyone involved in making RESTier the best API development platform for .NET. The following people have made various contributions to the codebase: | Microsoft | External | | - | - | | Lewis Cheng | Cengiz Ilerler | | Challenh | Kemal M | | Eric Erhardt | Robert McLaws | | Vincent He | | | Dong Liu | | | Layla Liu | | | Fan Ouyang | | | Congyong S | | | Mark Stafford | | | Ray Yao | | # Quickstart Source: https://easyaf.dev/restier/quickstart Get started with Restier in minutes \[THIS IS A PLACEHOLDER FOR FUTURE CONTENT] # AmazonSQSOptions Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Amazon/Core/AmazonSQSOptions Defines the configuration options available for SimpleMessageBus queues backed by Amazon SQS. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Amazon.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Amazon.Core **Inheritance:** CloudNimble.WebJobs.Extensions.Amazon.SQS.SQSOptions ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Amazon.Core.AmazonSQSOptions ``` ## Summary Defines the configuration options available for SimpleMessageBus queues backed by Amazon SQS. ## Remarks This class extends the base SQS options to provide SimpleMessageBus-specific configuration for Amazon SQS queues. It defines the three-queue pattern used by SimpleMessageBus: a main queue for processing, a poison queue for failed messages, and an optional completed queue for successfully processed messages. The SimpleMessageBus Amazon SQS provider follows AWS best practices for message processing and error handling, including dead letter queues, visibility timeouts, and message retention policies. ## Examples ```csharp theme={"dark"} // Configure Amazon SQS options in appsettings.json { "SimpleMessageBus": { "Amazon": { "QueueName": "myapp-messages", "PoisonQueueName": "myapp-messages-poison", "CompletedQueueName": "myapp-messages-completed", "Region": "us-west-2", "VisibilityTimeoutInSeconds": 300, "WaitTimeSeconds": 20 } } } // Or configure programmatically services.Configure<AmazonSQSOptions>(options => { options.QueueName = "myapp-messages"; options.PoisonQueueName = "myapp-messages-poison"; options.CompletedQueueName = "myapp-messages-completed"; options.Region = "us-west-2"; }); ``` ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public AmazonSQSOptions() ``` ## Properties ### CompletedQueueName Gets or sets the name of the queue to process for completed messages. #### Syntax ```csharp theme={"dark"} public string CompletedQueueName { get; set; } ``` #### Property Value Type: `string` The SQS queue name where successfully processed messages are optionally stored. This queue provides an audit trail of completed processing and can be used for analytics or compliance. #### Examples ```csharp theme={"dark"} options.CompletedQueueName = "myapp-messages-completed"; // This queue will contain messages that were successfully processed ``` #### Remarks The completed queue is optional. If not specified, successfully processed messages are simply deleted from the main queue. When specified, messages are moved to this queue after successful processing, allowing for audit trails and processing analytics. Queue names must follow AWS SQS naming conventions: 1-80 characters, alphanumeric plus hyphens and underscores. ### PoisonQueueName Gets or sets the name of the queue to process for poison messages. #### Syntax ```csharp theme={"dark"} public string PoisonQueueName { get; set; } ``` #### Property Value Type: `string` The SQS queue name where messages that fail processing multiple times are moved. This queue serves as a dead letter queue for failed message processing. #### Examples ```csharp theme={"dark"} options.PoisonQueueName = "myapp-messages-poison"; // Configure with longer retention for investigation // Queue should be monitored for failure patterns ``` #### Remarks The poison queue (dead letter queue) contains messages that have exceeded the maximum retry attempts and could not be processed successfully. These messages require manual intervention or specialized error handling workflows. The poison queue should have longer message retention periods to allow for investigation and recovery. It's recommended to monitor this queue for volume and patterns of failures, as high poison message volumes may indicate systemic issues in message processing or external dependencies. Queue names must follow AWS SQS naming conventions: 1-80 characters, alphanumeric plus hyphens and underscores. ### QueueName Gets or sets the name of the queue to process for the main messages. #### Syntax ```csharp theme={"dark"} public string QueueName { get; set; } ``` #### Property Value Type: `string` The primary SQS queue name where messages are published and from which they are consumed for processing. This is the main message processing queue in the SimpleMessageBus workflow. #### Examples ```csharp theme={"dark"} options.QueueName = "myapp-messages"; // or environment-specific naming options.QueueName = $"myapp-{environment}-messages"; ``` #### Remarks This is the primary queue where all messages are initially published and from which message handlers consume messages for processing. This queue should be configured with appropriate visibility timeouts, message retention periods, and dead letter queue policies. Queue names must follow AWS SQS naming conventions: 1-80 characters, alphanumeric plus hyphens and underscores. Consider using environment-specific prefixes for queue names to avoid conflicts between environments. # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Amazon/Core/index Summary of the CloudNimble.SimpleMessageBus.Amazon.Core Namespace ## Types ### Classes | Name | Summary | | - | - | | [AmazonSQSOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Amazon/Core/AmazonSQSOptions) | Defines the configuration options available for SimpleMessageBus queues backed by Amazon SQS. | # TestableMessagePublisher Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Breakdance/TestableMessagePublisher A test double for IMessagePublisher that captures published messages for assertions. Used in testing scenarios to verify that expected messages w... ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Breakdance.dll **Namespace:** CloudNimble.SimpleMessageBus.Breakdance **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Breakdance.TestableMessagePublisher ``` ## Summary A test double for IMessagePublisher that captures published messages for assertions. Used in testing scenarios to verify that expected messages were published correctly. ## Remarks The TestableMessagePublisher is designed for unit and integration testing of message publishing scenarios. It implements the IMessagePublisher interface but instead of sending messages to actual queues, it captures them in memory for verification. This enables testing of message publishing behavior without requiring real message queue infrastructure. Key testing features: * Captures all published messages for assertion * Supports configurable actions to simulate publish behavior * Provides methods to reset state between tests * Maintains message order for sequence verification This class is part of the "Breakdance" testing utilities, named after the dance style that emphasizes breaking conventional patterns - just like how test doubles break the normal execution flow for testing. ## Examples ```csharp theme={"dark"} // Basic usage in a unit test var publisher = new TestableMessagePublisher(); var messageHandler = new OrderHandler(publisher); // Execute the code under test await messageHandler.ProcessOrder(orderId); // Verify the expected messages were published Assert.AreEqual(2, publisher.PublishedMessages.Count); Assert.IsInstanceOfType(publisher.PublishedMessages[0], typeof(InventoryReservedMessage)); Assert.IsInstanceOfType(publisher.PublishedMessages[1], typeof(PaymentProcessedMessage)); // Advanced scenario with custom action var publisher = new TestableMessagePublisher(); publisher.SetAction((message, isSystem) => { // Simulate behavior like throwing exceptions for certain message types if (message is ProblemMessage) throw new InvalidOperationException("Simulated failure"); }); // Test exception handling in your code await Assert.ThrowsExceptionAsync<InvalidOperationException>(() => messageHandler.ProcessProblemScenario()); ``` ## Constructors ### .ctor Initializes a new instance of the [TestableMessagePublisher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Breakdance/TestableMessagePublisher) class. Creates an empty publisher with no published messages or configured actions. #### Syntax ```csharp theme={"dark"} public TestableMessagePublisher() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### PublishedMessages Gets a read-only list of all messages that have been published via this publisher. This collection can be used in test assertions to verify published message content. #### Syntax ```csharp theme={"dark"} public System.Collections.Generic.IReadOnlyList PublishedMessages { get; } ``` #### Property Value Type: `System.Collections.Generic.IReadOnlyList` A read-only list containing all messages published through this publisher in the order they were published. The collection is empty when the publisher is first created or after [TestableMessagePublisher.ClearMessages](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Breakdance/TestableMessagePublisher#clearmessages) is called. #### Examples ```csharp theme={"dark"} // Verify message count and types Assert.AreEqual(3, publisher.PublishedMessages.Count); Assert.IsTrue(publisher.PublishedMessages.Any(m => m is OrderCreatedMessage)); // Verify specific message content var orderMessage = publisher.PublishedMessages.OfType<OrderCreatedMessage>().First(); Assert.AreEqual("ORD-001", orderMessage.OrderNumber); // Verify message sequence Assert.IsInstanceOfType(publisher.PublishedMessages[0], typeof(OrderCreatedMessage)); Assert.IsInstanceOfType(publisher.PublishedMessages[1], typeof(InventoryReservedMessage)); Assert.IsInstanceOfType(publisher.PublishedMessages[2], typeof(PaymentProcessedMessage)); ``` #### Remarks This property provides access to all messages captured during testing. Messages are stored in publication order, allowing verification of both message content and sequence. The returned collection is read-only to prevent external modification of the test state. Use this property in test assertions to verify: * The correct number of messages were published * The right message types were published * Messages contain expected data * Messages were published in the correct order ## Methods ### ClearMessages Clears all published messages from the internal collection. Use this method to reset the state between tests. #### Syntax ```csharp theme={"dark"} public void ClearMessages() ``` #### Examples ```csharp theme={"dark"} [Test] public async Task Should_Publish_Order_Message() { // Arrange publisher.ClearMessages(); // Ensure clean state var order = new CreateOrderCommand { ProductId = "PROD-001" }; // Act await orderService.CreateOrderAsync(order); // Assert Assert.AreEqual(1, publisher.PublishedMessages.Count); Assert.IsInstanceOfType(publisher.PublishedMessages[0], typeof(OrderCreatedMessage)); } ``` #### Remarks This method is typically called in test setup or teardown to ensure each test starts with a clean state. After calling this method, the [TestableMessagePublisher.PublishedMessages](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Breakdance/TestableMessagePublisher#publishedmessages) collection will be empty until new messages are published. This prevents test interference where one test's published messages affect another test's assertions. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### PublishAsync Implements the IMessagePublisher interface method by capturing the published message for later assertion and optionally invoking a configured action. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task PublishAsync(CloudNimble.SimpleMessageBus.Core.IMessage message, bool isSystemGenerated = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `CloudNimble.SimpleMessageBus.Core.IMessage` | The message to publish. | | `isSystemGenerated` | `bool` | Indicates whether the message is system-generated. | #### Returns Type: `System.Threading.Tasks.Task` A completed task. #### Exceptions | Exception | Description | | - | - | | `Exception` | May throw exceptions if a custom action configured via `Boolean})` throws. | #### Examples ```csharp theme={"dark"} // Direct usage (though typically called by code under test) var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; await publisher.PublishAsync(message, isSystemGenerated: false); // Verify it was captured Assert.AreEqual(1, publisher.PublishedMessages.Count); Assert.AreSame(message, publisher.PublishedMessages[0]); ``` #### Remarks This method implements the core functionality of the test double by: 1. Adding the message to the internal collection for later verification 2. Invoking any configured action (if set via `Boolean})`) 3. Returning a completed task to satisfy the async interface Unlike real message publishers, this method does not actually send messages to any queue. It completes synchronously and never throws exceptions unless a custom action is configured to do so. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### SetAction Sets an action to be executed when a message is published. #### Syntax ```csharp theme={"dark"} public void SetAction(System.Action onPublish) ``` #### Parameters | Name | Type | Description | | - | - | - | | `onPublish` | `System.Action` | The action to execute when PublishAsync is called. | | The action receives the published message and the isSystemGenerated flag. | | | #### Examples ```csharp theme={"dark"} // Simulate publishing failures for certain message types publisher.SetAction((message, isSystem) => { if (message is CriticalMessage) throw new InvalidOperationException("Publishing service unavailable"); }); // Simulate side effects like logging or notifications publisher.SetAction((message, isSystem) => { if (isSystem) systemMessageCount++; logger.LogInformation("Published {MessageType}", message.GetType().Name); }); // Remove the action publisher.SetAction(null); ``` #### Remarks This method allows customization of the publisher's behavior during testing. The configured action is invoked after the message is added to the [TestableMessagePublisher.PublishedMessages](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Breakdance/TestableMessagePublisher#publishedmessages) collection, allowing for simulation of various publishing scenarios such as failures, delays, or side effects. Setting this to null removes any previously configured action. The action is optional and publishing will work normally even without it being set. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Publish.IMessagePublisher # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Breakdance/index Summary of the CloudNimble.SimpleMessageBus.Breakdance Namespace ## Types ### Classes | Name | Summary | | - | - | | [TestableMessagePublisher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Breakdance/TestableMessagePublisher) | A test double for IMessagePublisher that captures published messages for assertions. Used in testing scenarios to verify that expected messages were published correctly. | # AzureStorageQueueConstants Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueConstants A set of helpers to convert file system-related magic strings to compiled references. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.AzureStorageQueueConstants ``` ## Summary A set of helpers to convert file system-related magic strings to compiled references. # AzureStorageQueueEncoding Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueEncoding Determines how QueueMessage.Body is represented in HTTP requests and responses. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.AzureStorageQueueEncoding ``` ## Summary Determines how QueueMessage.Body is represented in HTTP requests and responses. ## Values | Name | Value | Description | | - | - | - | | `None` | 0 | The QueueMessage.Body is represented verbatim in HTTP requests and responses. I.e. message is not transformed. | | `Base64` | 1 | The QueueMessage.Body is represented as Base64 encoded string in HTTP requests and responses. | # AzureStorageQueueOptions Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueOptions Specifies the options required to leverage Azure Queue Storage as the SimpleMessageBus backing queue. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.AzureStorageQueueOptions ``` ## Summary Specifies the options required to leverage Azure Queue Storage as the SimpleMessageBus backing queue. ## Constructors ### .ctor The default constructor, which sets the default values equal to the values specified in [AzureStorageQueueConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueConstants). #### Syntax ```csharp theme={"dark"} public AzureStorageQueueOptions() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CompletedQueueName A [String](https://learn.microsoft.com/dotnet/api/system.string) representing the name of the Queue that successfully-executed messages will be stored in. #### Syntax ```csharp theme={"dark"} public string CompletedQueueName { get; set; } ``` #### Property Value Type: `string` #### Remarks Messages will stay in that Queue for the lifetime specified by the Queue, and is useful for diagnosing or re-running requests. ### ConcurrentJobs An [Int32](https://learn.microsoft.com/dotnet/api/system.int32) representing the number of Messages that can be processed simultaneously. The default is 16. #### Syntax ```csharp theme={"dark"} public int ConcurrentJobs { get; set; } ``` #### Property Value Type: `int` ### MessageEncoding Sets the MessageEncoding for Queue messages. Defaults to AzureStorageQueueEncoding.None. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Core.AzureStorageQueueEncoding MessageEncoding { get; set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Core.AzureStorageQueueEncoding` #### Remarks SimpleMessageBus defaulted to None in previous versions. This setting helps align the Azure Queues SDK QueueClient, which by default sets MessageEncoding = QueueMessageEncoding.None, and WebJobs SDK QueueTrigger, which by default sets MessageEncoding = QueueMessageEncoding.Base64. (I know, isn't that awesome?!?). ### QueueName A [String](https://learn.microsoft.com/dotnet/api/system.string) representing the name of the Queue in Azure Queue Storage. #### Syntax ```csharp theme={"dark"} public string QueueName { get; set; } ``` #### Property Value Type: `string` #### Remarks See [https://coderwall.com/p/g2xeua](https://coderwall.com/p/g2xeua) for more information about queue name requirements. ### StorageConnectionString A [String](https://learn.microsoft.com/dotnet/api/system.string) representing the ConnectionString for your Azure Storage account. #### Syntax ```csharp theme={"dark"} public string StorageConnectionString { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # FileSystemConstants Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/FileSystemConstants A set of helpers to convert file system-related magic strings to compiled references. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.FileSystemConstants ``` ## Summary A set of helpers to convert file system-related magic strings to compiled references. # FileSystemOptions Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/FileSystemOptions Specifies the options required to leverage the local file system as the SimpleMessageBus backing queue. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.FileSystemOptions ``` ## Summary Specifies the options required to leverage the local file system as the SimpleMessageBus backing queue. ## Constructors ### .ctor The default constructor, which sets the default values equal to the values specified in [FileSystemConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/FileSystemConstants). #### Syntax ```csharp theme={"dark"} public FileSystemOptions() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CompletedFolderPath The folder segment where successfully-processed queue items will be moved to upon completion. #### Syntax ```csharp theme={"dark"} public string CompletedFolderPath { get; } ``` #### Property Value Type: `string` ### ErrorFolderPath The folder segment where failed items will be stored while they are waiting to be analyzed and reprocessed. #### Syntax ```csharp theme={"dark"} public string ErrorFolderPath { get; } ``` #### Property Value Type: `string` ### IsNetworkPath Gets a boolean specifying whether or not the [FileSystemOptions.RootFolder](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/FileSystemOptions#rootfolder) is a network path (either a UNC or mapped drive). #### Syntax ```csharp theme={"dark"} public bool IsNetworkPath { get; } ``` #### Property Value Type: `bool` ### QueueFolderPath The folder segment where items will be stored while they are waiting to be processed. #### Syntax ```csharp theme={"dark"} public string QueueFolderPath { get; } ``` #### Property Value Type: `string` ### RootFolder A string representing the folder that will hold the three required queue folders. #### Syntax ```csharp theme={"dark"} public string RootFolder { get; set; } ``` #### Property Value Type: `string` ### VirusScanDelayInSeconds An integer representing the number of seconds to wait before firing FileSystemWatcher events to process the Queue. #### Syntax ```csharp theme={"dark"} public int VirusScanDelayInSeconds { get; set; } ``` #### Property Value Type: `int` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # IMessage Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage Defines the required composition of every Message published to the SimpleMessageBus. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.IMessage ``` ## Summary Defines the required composition of every Message published to the SimpleMessageBus. ## Remarks All messages in the SimpleMessageBus system must implement this interface. The Id property ensures that each message can be uniquely identified throughout its lifecycle, including during processing, error handling, and when moved to poison queues. ## Examples ```csharp theme={"dark"} public class OrderCreatedMessage : IMessage { public Guid Id { get; set; } = Guid.NewGuid(); public string OrderNumber { get; set; } public decimal TotalAmount { get; set; } public DateTime CreatedAt { get; set; } } ``` ## Properties ### Id Abstract Gets or sets the unique identifier for this Message. #### Syntax ```csharp theme={"dark"} System.Guid Id { get; set; } ``` #### Property Value Type: `System.Guid` A [Guid](https://learn.microsoft.com/dotnet/api/system.guid) that uniquely identifies this message instance. This value should be set when the message is created and remain constant throughout the message's lifetime. #### Remarks This identifier is used for tracking messages through the system, deduplication, and correlating messages in poison queues with their original instances. ## Methods ### CreateChild Extension Extension method from `CloudNimble.SimpleMessageBus.Core.MessageExtensions` Creates a child message that inherits metadata and correlation from the parent. #### Syntax ```csharp theme={"dark"} public static TChild CreateChild(CloudNimble.SimpleMessageBus.Core.IMessage parent) where TChild : CloudNimble.SimpleMessageBus.Core.MessageBase, new() ``` #### Parameters | Name | Type | Description | | - | - | - | | `parent` | `CloudNimble.SimpleMessageBus.Core.IMessage` | The parent message. | #### Returns Type: `TChild` A new child message with inherited metadata and correlation. #### Type Parameters * `TChild` - The type of child message to create. #### Examples ```csharp theme={"dark"} // Create a child event that inherits filtered parent metadata var shipmentRequested = message.CreateChild<ShipmentRequested>(); shipmentRequested.OrderId = message.OrderId; shipmentRequested.Items = result.Items; await publisher.PublishAsync(shipmentRequested); ``` ### LastRunSucceeded Extension Extension method from `CloudNimble.SimpleMessageBus.Core.MessageExtensions` Checks if the current handler has already successfully processed this message. This enables idempotent message processing. #### Syntax ```csharp theme={"dark"} public static bool LastRunSucceeded(CloudNimble.SimpleMessageBus.Core.IMessage message, string handlerTypeName = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `CloudNimble.SimpleMessageBus.Core.IMessage` | The message to check. | | `handlerTypeName` | `string` | The handler type name. If not provided, attempts to detect from call stack. | #### Returns Type: `bool` `true` if this handler already ran successfully; otherwise, `false`. #### Examples ```csharp theme={"dark"} public async Task Handle(OrderCreated message, ILogger logger) { if (message.LastRunSucceeded(GetType().Name)) { logger.LogInformation("Order {OrderId} already processed successfully", message.Id); return; } // Process the message... message.UpdateResult(true, GetType().Name); } ``` ### UpdateResult Extension Extension method from `CloudNimble.SimpleMessageBus.Core.MessageExtensions` Updates the execution status for the current handler. #### Syntax ```csharp theme={"dark"} public static void UpdateResult(CloudNimble.SimpleMessageBus.Core.IMessage message, bool status, string handlerTypeName = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `CloudNimble.SimpleMessageBus.Core.IMessage` | The message to update. | | `status` | `bool` | The execution status to record. | | `handlerTypeName` | `string` | The handler type name. If not provided, attempts to detect from call stack. | #### Examples ```csharp theme={"dark"} public async Task Handle(OrderCreated message, ILogger logger) { try { await ProcessOrder(message); message.UpdateResult(true, GetType().Name); } catch (Exception ex) { logger.LogError(ex, "Failed to process order"); message.UpdateResult(false, GetType().Name); throw; } } ``` # IMessageHandler Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler Defines the functionality required for all [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) processing handlers. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.IMessageHandler ``` ## Summary Defines the functionality required for all [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) processing handlers. ## Remarks Message handlers are the core processing units in SimpleMessageBus. They receive messages from queues, process them according to business logic, and handle any errors that occur during processing. Handlers can process multiple message types and are responsible for declaring which types they support. ## Examples ```csharp theme={"dark"} public class OrderMessageHandler : IMessageHandler { private readonly IOrderService _orderService; public OrderMessageHandler(IOrderService orderService) { _orderService = orderService; } public IEnumerable<Type> GetHandledMessageTypes() { yield return typeof(OrderCreatedMessage); yield return typeof(OrderUpdatedMessage); } public async Task OnNextAsync(MessageEnvelope messageEnvelope) { switch (messageEnvelope.Message) { case OrderCreatedMessage created: await _orderService.ProcessNewOrderAsync(created); break; case OrderUpdatedMessage updated: await _orderService.UpdateOrderAsync(updated); break; } } public async Task OnErrorAsync(IMessage message, Exception exception) { // Log the error and potentially send notifications await _orderService.HandleProcessingErrorAsync(message, exception); } } ``` ## Methods ### GetHandledMessageTypes Abstract Specifies which [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) types are handled by this [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler). #### Syntax ```csharp theme={"dark"} System.Collections.Generic.IEnumerable GetHandledMessageTypes() ``` #### Returns Type: `System.Collections.Generic.IEnumerable` An [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) containing all of the [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) types this [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler) supports. The types must implement [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage). #### Examples ```csharp theme={"dark"} public IEnumerable<Type> GetHandledMessageTypes() { yield return typeof(OrderCreatedMessage); yield return typeof(OrderCancelledMessage); yield return typeof(OrderShippedMessage); } ``` #### Remarks This method is called during handler registration to determine message routing. Return all message types that this handler can process. The framework will ensure that only messages of these types are delivered to this handler's `MessageEnvelope)` method. ### OnErrorAsync Abstract Specifies what this handler should do when an error occurs during processing. #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task OnErrorAsync(CloudNimble.SimpleMessageBus.Core.IMessage message, System.Exception exception) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `CloudNimble.SimpleMessageBus.Core.IMessage` | The deserialized [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) instance that failed. | | `exception` | `System.Exception` | The [Exception](https://learn.microsoft.com/dotnet/api/system.exception) that occurred during processing. | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) reference for the asynchronous function. #### Examples ```csharp theme={"dark"} public async Task OnErrorAsync(IMessage message, Exception exception) { _logger.LogError(exception, "Failed to process {MessageType} with ID {MessageId}", message.GetType().Name, message.Id); // Send alert for critical messages if (message is CriticalBusinessMessage) { await _alertService.SendFailureAlertAsync(message, exception); } } ``` #### Remarks This method is called when an exception is thrown during message processing. Use this method to implement custom error handling logic such as logging, alerting, or compensating transactions. Note that after this method completes, the message will typically be moved to a poison queue unless retry policies dictate otherwise. ### OnNextAsync Abstract Specifies what this handler should do when it is time to process the [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope). #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task OnNextAsync(CloudNimble.SimpleMessageBus.Core.MessageEnvelope messageEnvelope) ``` #### Parameters | Name | Type | Description | | - | - | - | | `messageEnvelope` | `CloudNimble.SimpleMessageBus.Core.MessageEnvelope` | The [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) to process. | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) reference for the asynchronous function. #### Examples ```csharp theme={"dark"} public async Task OnNextAsync(MessageEnvelope messageEnvelope) { // Extract metadata if available var userId = messageEnvelope.Metadata?.GetValueOrDefault("UserId"); // Process based on message type switch (messageEnvelope.Message) { case OrderCreatedMessage order: await ProcessOrderAsync(order, userId?.ToString()); break; default: throw new NotSupportedException($"Message type {messageEnvelope.Message.GetType()} not supported"); } } ``` #### Remarks This is the main processing method for messages. The framework calls this method when a message of a supported type (as declared by [IMessageHandler.GetHandledMessageTypes](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler#gethandledmessagetypes)) is received from the queue. The message is pre-deserialized and available in the [MessageEnvelope.Message](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#message) property. Any unhandled exceptions thrown from this method will trigger a call to `Exception)`. # IMetadataAware Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMetadataAware Defines a message that supports metadata for passing data between handlers in the processing pipeline. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.IMetadataAware ``` ## Summary Defines a message that supports metadata for passing data between handlers in the processing pipeline. ## Remarks Metadata provides a way to attach additional context and data to messages without modifying the core message structure. This is particularly useful for cross-cutting concerns like tracking, auditing, user context, and handler-to-handler communication. The metadata survives serialization and can be accessed by any handler in the processing chain. ## Examples ```csharp theme={"dark"} public class OrderCreatedMessage : IMessage, IMetadataAware { public Guid Id { get; set; } = Guid.NewGuid(); public ConcurrentDictionary<string, object> Metadata { get; set; } = new(); public string OrderNumber { get; set; } public decimal Amount { get; set; } } // Usage in handler public async Task OnNextAsync(MessageEnvelope envelope) { if (envelope.Message is IMetadataAware metadataMessage) { // Read metadata set by previous handlers var userId = metadataMessage.Metadata.GetValueOrDefault("UserId"); var requestId = metadataMessage.Metadata.GetValueOrDefault("RequestId"); // Add new metadata for downstream handlers metadataMessage.Metadata["ProcessedBy"] = "OrderHandler"; metadataMessage.Metadata["ProcessedAt"] = DateTime.UtcNow; } } ``` ## Properties ### Metadata Abstract Gets or sets the thread-safe metadata storage for passing data between handlers in the processing pipeline. #### Syntax ```csharp theme={"dark"} System.Collections.Concurrent.ConcurrentDictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Concurrent.ConcurrentDictionary` A [ConcurrentDictionary\`2](https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2) where keys are string identifiers and values are objects containing the metadata. The dictionary must be thread-safe as it may be accessed concurrently. #### Examples ```csharp theme={"dark"} // Setting metadata in a publisher var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; message.Metadata["UserId"] = currentUser.Id; message.Metadata["RequestId"] = Guid.NewGuid(); message.Metadata["Source"] = "WebAPI"; // Reading metadata in a handler var userId = message.Metadata.GetValueOrDefault("UserId")?.ToString(); var isFromAPI = message.Metadata.ContainsKey("Source") && message.Metadata["Source"].ToString() == "WebAPI"; ``` #### Remarks This metadata dictionary is preserved during message serialization/deserialization and provides a mechanism for handlers to communicate with each other without coupling their interfaces. Common use cases include tracking user context, request IDs, processing timestamps, and handler-specific state. When using metadata, prefer well-known key names and document their usage to avoid conflicts between handlers. Values should be serializable types to ensure compatibility across different storage providers. # ITrackable Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/ITrackable Defines a message that can track its parent for message lineage and correlation across the processing chain. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.ITrackable ``` ## Summary Defines a message that can track its parent for message lineage and correlation across the processing chain. ## Remarks Message tracking enables building a complete audit trail of how messages flow through the system and which messages are related to each other. This is essential for debugging, monitoring, and understanding complex business processes that span multiple message types and handlers. The ParentId property creates a direct parent-child relationship, while CorrelationId groups all related messages in the same business transaction or workflow, regardless of their hierarchical relationship. ## Examples ```csharp theme={"dark"} // Original message starts a workflow var orderCreated = new OrderCreatedMessage { Id = Guid.NewGuid(), CorrelationId = Guid.NewGuid(), // New workflow ParentId = null, // No parent, this is the root OrderNumber = "ORD-001" }; // Child message spawned during processing var inventoryReserved = new InventoryReservedMessage { Id = Guid.NewGuid(), CorrelationId = orderCreated.CorrelationId, // Same workflow ParentId = orderCreated.Id, // Direct child of order created ProductId = "PROD-123", Quantity = 2 }; // Another child in the same workflow var paymentProcessed = new PaymentProcessedMessage { Id = Guid.NewGuid(), CorrelationId = orderCreated.CorrelationId, // Same workflow ParentId = orderCreated.Id, // Also child of order created Amount = 99.99m }; ``` ## Properties ### CorrelationId Abstract Gets or sets the correlation ID for tracking related messages across the entire processing chain. #### Syntax ```csharp theme={"dark"} System.Guid CorrelationId { get; set; } ``` #### Property Value Type: `System.Guid` A [Guid](https://learn.microsoft.com/dotnet/api/system.guid) that groups all messages belonging to the same business transaction or workflow. All related messages should share the same correlation ID regardless of their parent-child relationships. #### Examples ```csharp theme={"dark"} // Starting a new workflow var rootMessage = new OrderCreatedMessage { CorrelationId = Guid.NewGuid() // New workflow starts here }; // All subsequent messages inherit the same correlation ID var paymentMessage = new ProcessPaymentMessage { CorrelationId = rootMessage.CorrelationId // Same workflow }; var shippingMessage = new ArrangeShippingMessage { CorrelationId = rootMessage.CorrelationId // Same workflow }; // Now all three messages can be correlated together in logs and monitoring ``` #### Remarks The correlation ID provides a way to group all messages that are part of the same logical operation or business process. Unlike ParentId which shows direct parent-child relationships, CorrelationId creates a flat grouping that spans the entire workflow. This is particularly useful for distributed tracing, log correlation, and understanding the full scope of a business operation that may spawn many parallel or sequential message processing paths. For new workflows, generate a new correlation ID. For messages created in response to existing messages, inherit the correlation ID from the triggering message. ### ParentId Abstract Gets or sets the ID of the parent message that triggered this message, enabling message lineage tracking. #### Syntax ```csharp theme={"dark"} System.Nullable ParentId { get; set; } ``` #### Property Value Type: `System.Nullable` A nullable [Guid](https://learn.microsoft.com/dotnet/api/system.guid) that identifies the immediate parent message. This value should be null for root messages that start a new workflow, and set to the parent's ID for derived or spawned messages. #### Examples ```csharp theme={"dark"} // In a message handler creating child messages public async Task OnNextAsync(MessageEnvelope envelope) { var parentMessage = envelope.Message; // Create child messages with proper lineage var childMessage = new ChildMessage { ParentId = parentMessage.Id, // Link to parent CorrelationId = (parentMessage as ITrackable)?.CorrelationId ?? Guid.NewGuid() }; await _publisher.PublishAsync(childMessage); } ``` #### Remarks Use this property to build a hierarchical tree of message relationships. This enables tracing the exact sequence of message creation and understanding which message triggered which other messages. Combined with logging and monitoring, this provides powerful debugging and auditing capabilities. When creating child messages in response to a parent message, always set this property to maintain the lineage chain. # KafkaAuthenticationMode Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaAuthenticationMode SASL authentication mechanisms for Kafka. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.KafkaAuthenticationMode ``` ## Summary SASL authentication mechanisms for Kafka. ## Values | Name | Value | Description | | - | - | - | | `NotSet` | 0 | No authentication configured. | | `Plain` | 1 | PLAIN mechanism (username/password). | | `ScramSha256` | 2 | SCRAM-SHA-256 mechanism. | | `ScramSha512` | 3 | SCRAM-SHA-512 mechanism. | | `Gssapi` | 4 | Kerberos (GSSAPI) authentication. | # KafkaBrokerProtocol Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaBrokerProtocol Kafka security protocol options. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Enum ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.KafkaBrokerProtocol ``` ## Summary Kafka security protocol options. ## Values | Name | Value | Description | | - | - | - | | `Plaintext` | 0 | Plain text communication (no encryption). | | `Ssl` | 1 | SSL/TLS encrypted communication. | | `SaslPlaintext` | 2 | SASL authentication over plain text. | | `SaslSsl` | 3 | SASL authentication over SSL/TLS. | # KafkaConstants Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaConstants Constants for Kafka topic and consumer group configuration placeholders. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.KafkaConstants ``` ## Summary Constants for Kafka topic and consumer group configuration placeholders. # KafkaOptions Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaOptions Specifies the options required to leverage Apache Kafka as the SimpleMessageBus backing queue. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.KafkaOptions ``` ## Summary Specifies the options required to leverage Apache Kafka as the SimpleMessageBus backing queue. ## Constructors ### .ctor Creates a new instance with default values from [KafkaConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaConstants). #### Syntax ```csharp theme={"dark"} public KafkaOptions() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AuthenticationMode The SASL authentication mechanism when using SASL protocols. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Core.KafkaAuthenticationMode AuthenticationMode { get; set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Core.KafkaAuthenticationMode` ### BrokerList The Kafka broker list (e.g., "localhost:9092" or "broker1:9092,broker2:9092"). #### Syntax ```csharp theme={"dark"} public string BrokerList { get; set; } ``` #### Property Value Type: `string` ### ConsumerGroup The consumer group ID for message consumption. #### Syntax ```csharp theme={"dark"} public string ConsumerGroup { get; set; } ``` #### Property Value Type: `string` ### MaxBatchSize Maximum number of messages to process in a batch. Default is 64. #### Syntax ```csharp theme={"dark"} public int MaxBatchSize { get; set; } ``` #### Property Value Type: `int` ### Password SASL password for authentication. #### Syntax ```csharp theme={"dark"} public string Password { get; set; } ``` #### Property Value Type: `string` ### Protocol The security protocol for broker communication. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Core.KafkaBrokerProtocol Protocol { get; set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Core.KafkaBrokerProtocol` ### SslCaLocation Path to CA certificate file for SSL/TLS verification. #### Syntax ```csharp theme={"dark"} public string SslCaLocation { get; set; } ``` #### Property Value Type: `string` ### TopicName The name of the Kafka topic for messages. #### Syntax ```csharp theme={"dark"} public string TopicName { get; set; } ``` #### Property Value Type: `string` ### Username SASL username for authentication. #### Syntax ```csharp theme={"dark"} public string Username { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # MessageBase Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageBase Base class providing a complete implementation of common message functionality. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.MessageBase ``` ## Summary Base class providing a complete implementation of common message functionality. ## Remarks MessageBase provides a convenient base class that implements all core message interfaces, making it easy to create new message types without having to implement the common functionality manually. It automatically handles ID generation, metadata initialization, tracking properties, and provides constructors for creating child messages with proper lineage tracking. This class is abstract and must be inherited to create concrete message types. It's recommended to use this base class for most message implementations unless you have specific requirements that prevent inheritance. ## Examples ```csharp theme={"dark"} // Simple message inheriting from MessageBase public class OrderCreatedMessage : MessageBase { public string OrderNumber { get; set; } public decimal TotalAmount { get; set; } public DateTime CreatedAt { get; set; } } // Creating a root message var orderMessage = new OrderCreatedMessage { OrderNumber = "ORD-001", TotalAmount = 99.99m, CreatedAt = DateTime.UtcNow }; // Creating a child message with proper lineage public class PaymentProcessedMessage : MessageBase { public decimal Amount { get; set; } public string PaymentMethod { get; set; } public PaymentProcessedMessage(IMessage parent) : base(parent) { // Child-specific initialization } } var paymentMessage = new PaymentProcessedMessage(orderMessage) { Amount = 99.99m, PaymentMethod = "CreditCard" }; // paymentMessage.ParentId == orderMessage.Id // paymentMessage.CorrelationId == orderMessage.CorrelationId ``` ## Constructors ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CorrelationId #### Syntax ```csharp theme={"dark"} public System.Guid CorrelationId { get; set; } ``` #### Property Value Type: `System.Guid` ### Id #### Syntax ```csharp theme={"dark"} public System.Guid Id { get; set; } ``` #### Property Value Type: `System.Guid` ### Metadata #### Syntax ```csharp theme={"dark"} public System.Collections.Concurrent.ConcurrentDictionary Metadata { get; set; } ``` #### Property Value Type: `System.Collections.Concurrent.ConcurrentDictionary` ### ParentId #### Syntax ```csharp theme={"dark"} public System.Nullable ParentId { get; set; } ``` #### Property Value Type: `System.Nullable` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Core.IMessage * CloudNimble.SimpleMessageBus.Core.IMetadataAware * CloudNimble.SimpleMessageBus.Core.ITrackable # MessageEnvelope Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope Represents a wrapper for an [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) that will be published to the SimpleMessageBus Queue. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Core.MessageEnvelope ``` ## Summary Represents a wrapper for an [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) that will be published to the SimpleMessageBus Queue. ## Remarks The MessageEnvelope provides the transport container for messages within the SimpleMessageBus system. It wraps the actual message with metadata needed for processing, error handling, and tracking. The envelope handles message serialization/deserialization and provides processing context for handlers. Key responsibilities include: * Serializing messages for storage in queues * Tracking processing attempts and timestamps * Providing handler context through service scope and logging * Managing message state during processing pipeline * Facilitating message deserialization for handlers ## Examples ```csharp theme={"dark"} // Creating an envelope (typically done automatically by publishers) var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; var envelope = new MessageEnvelope(message); // Processing an envelope in a handler public async Task OnNextAsync(MessageEnvelope envelope) { // Access metadata var attempts = envelope.AttemptsCount; var published = envelope.DatePublished; // Extract the message var orderMessage = envelope.GetMessage<OrderCreatedMessage>(); // Use the logger for this specific message envelope.ProcessLog?.LogInformation("Processing order {OrderNumber}", orderMessage.OrderNumber); // Process the message... } ``` ## Constructors ### .ctor Initializes a new instance of the [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) class. #### Syntax ```csharp theme={"dark"} public MessageEnvelope() ``` #### Remarks This parameterless constructor should only be used for deserializing the MessageEnvelope from storage. For creating new envelopes to wrap messages, use the `IMessage)` constructor instead. ### .ctor Initializes a new instance of the [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) class for a given [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage). #### Syntax ```csharp theme={"dark"} public MessageEnvelope(CloudNimble.SimpleMessageBus.Core.IMessage message) ``` #### Parameters | Name | Type | Description | | - | - | - | | `message` | `CloudNimble.SimpleMessageBus.Core.IMessage` | The [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) instance that will be wrapped in a [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) to be posted to the SimpleMessageBus. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *message* is null. | #### Examples ```csharp theme={"dark"} var message = new OrderCreatedMessage { OrderNumber = "ORD-001", CustomerId = customerId, TotalAmount = 99.99m }; var envelope = new MessageEnvelope(message); // envelope.Id is automatically generated // envelope.DatePublished is set to now // envelope.MessageType contains the full type name // envelope.MessageContent contains the JSON serialized message ``` #### Remarks This constructor automatically serializes the message to JSON, generates a unique envelope ID, sets the publish timestamp to the current UTC time, and extracts the message type information for later deserialization. The resulting envelope is ready to be published to any queue provider. ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### AttemptsCount The number of times the system has previously attempted to process this message. #### Syntax ```csharp theme={"dark"} public long AttemptsCount { get; set; } ``` #### Property Value Type: `long` ### DatePublished The UTC date and time that this nessage was published to the queue. #### Syntax ```csharp theme={"dark"} public System.DateTimeOffset DatePublished { get; set; } ``` #### Property Value Type: `System.DateTimeOffset` ### Id A [Guid](https://learn.microsoft.com/dotnet/api/system.guid) uniquely identifying this message on the queue. Helps when looking at logs or correlating from telemetry. #### Syntax ```csharp theme={"dark"} public System.Guid Id { get; set; } ``` #### Property Value Type: `System.Guid` ### Message Gets the deserialized message instance. #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Core.IMessage Message { get; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Core.IMessage` The [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) instance deserialized from [MessageEnvelope.MessageContent](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagecontent) using the type specified in [MessageEnvelope.MessageType](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagetype). This property provides convenient access to the message without requiring explicit type specification in handlers. #### Exceptions | Exception | Description | | - | - | | `InvalidOperationException` | Thrown when the message type cannot be resolved or deserialization fails. | #### Examples ```csharp theme={"dark"} public async Task OnNextAsync(MessageEnvelope envelope) { // Type-safe access without specifying the type switch (envelope.Message) { case OrderCreatedMessage order: await ProcessOrderAsync(order); break; case PaymentProcessedMessage payment: await ProcessPaymentAsync(payment); break; default: throw new NotSupportedException($"Unknown message type: {envelope.MessageType}"); } } ``` #### Remarks This property deserializes the message on each access. For performance-critical scenarios where the message is accessed multiple times, consider caching the result or using the typed `GetMessage``1` method. The deserialization uses the [MessageEnvelope.MessageType](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagetype) to determine the target type and deserializes the [MessageEnvelope.MessageContent](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagecontent) JSON string into the appropriate message instance. ### MessageContent The serialized content of the [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage). #### Syntax ```csharp theme={"dark"} public string MessageContent { get; set; } ``` #### Property Value Type: `string` ### MessageState A container to help track the state of a message as it flows between [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\. This value is ignored by the serializer and will not be persisted between failed message runs. #### Syntax ```csharp theme={"dark"} public dynamic MessageState { get; private set; } ``` #### Property Value Type: `dynamic` ### MessageType A string representing the type name of the message. Defaults to IMessage.GetType().AssemblyQualifiedName". #### Syntax ```csharp theme={"dark"} public string MessageType { get; set; } ``` #### Property Value Type: `string` ### ProcessLog The processing log for this particular message across all MessageHandlers. #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.Logging.ILogger ProcessLog { get; set; } ``` #### Property Value Type: `Microsoft.Extensions.Logging.ILogger` ### ServiceScope The processing log for this particular message across all MessageHandlers. #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.DependencyInjection.IServiceScope ServiceScope { get; set; } ``` #### Property Value Type: `Microsoft.Extensions.DependencyInjection.IServiceScope` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetMessage Retrieves the [MessageEnvelope.MessageContent](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagecontent) deserialized into an [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) of the specified type. #### Syntax ```csharp theme={"dark"} public T GetMessage() where T : CloudNimble.SimpleMessageBus.Core.IMessage ``` #### Returns Type: `T` A concrete *T* instance populated with the data from the [MessageEnvelope.MessageContent](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagecontent). #### Type Parameters * `T` - The [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) type represented by the [MessageEnvelope.MessageContent](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagecontent). #### Exceptions | Exception | Description | | - | - | | `JsonException` | Thrown when the [MessageEnvelope.MessageContent](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagecontent) cannot be deserialized to type *T*. | | `ArgumentNullException` | Thrown when [MessageEnvelope.MessageContent](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagecontent) is null. | #### Examples ```csharp theme={"dark"} public async Task OnNextAsync(MessageEnvelope envelope) { // Type-safe deserialization when you know the expected type var orderMessage = envelope.GetMessage<OrderCreatedMessage>(); // Process the strongly-typed message await ProcessOrderAsync(orderMessage.OrderNumber, orderMessage.TotalAmount); } ``` #### Remarks This method provides type-safe deserialization when you know the exact message type at compile time. It directly deserializes the JSON content without using the [MessageEnvelope.MessageType](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#messagetype) property for type resolution. This can be more performant than the [MessageEnvelope.Message](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope#message) property for known types, but requires explicit type specification. ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Override #### Syntax ```csharp theme={"dark"} public override string ToString() ``` #### Returns Type: `string` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/index Summary of the CloudNimble.SimpleMessageBus.Core Namespace ## Types ### Classes | Name | Summary | | - | - | | [AzureStorageQueueConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueConstants) | A set of helpers to convert file system-related magic strings to compiled references. | | [AzureStorageQueueEncoding](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueEncoding) | Determines how QueueMessage.Body is represented in HTTP requests and responses. | | [AzureStorageQueueOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueOptions) | Specifies the options required to leverage Azure Queue Storage as the SimpleMessageBus backing queue. | | [FileSystemConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/FileSystemConstants) | A set of helpers to convert file system-related magic strings to compiled references. | | [FileSystemOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/FileSystemOptions) | Specifies the options required to leverage the local file system as the SimpleMessageBus backing queue. | | [KafkaAuthenticationMode](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaAuthenticationMode) | SASL authentication mechanisms for Kafka. | | [KafkaBrokerProtocol](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaBrokerProtocol) | Kafka security protocol options. | | [KafkaConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaConstants) | Constants for Kafka topic and consumer group configuration placeholders. | | [KafkaOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaOptions) | Specifies the options required to leverage Apache Kafka as the SimpleMessageBus backing queue. | | [MessageBase](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageBase) | Base class providing a complete implementation of common message functionality. | | [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) | Represents a wrapper for an [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) that will be published to the SimpleMessageBus Queue. | ### Interfaces | Name | Summary | | - | - | | [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) | Defines the required composition of every Message published to the SimpleMessageBus. | | [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler) | Defines the functionality required for all [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage) processing handlers. | | [IMetadataAware](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMetadataAware) | Defines a message that supports metadata for passing data between handlers in the processing pipeline. | | [ITrackable](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/ITrackable) | Defines a message that can track its parent for message lineage and correlation across the processing chain. | ### Enums | Name | Summary | | - | - | | [AzureStorageQueueEncoding](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/AzureStorageQueueEncoding) | Determines how QueueMessage.Body is represented in HTTP requests and responses. | | [KafkaAuthenticationMode](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaAuthenticationMode) | SASL authentication mechanisms for Kafka. | | [KafkaBrokerProtocol](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/KafkaBrokerProtocol) | Kafka security protocol options. | # AmazonSQSConstants Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/AmazonSQSConstants A set of constants for SimpleMessageBus instances backed by Amazon SQS. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.Amazon.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Amazon **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Amazon.AmazonSQSConstants ``` ## Summary A set of constants for SimpleMessageBus instances backed by Amazon SQS. # AmazonSQSProcessor Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/AmazonSQSProcessor Processes messages from Amazon SQS queues for SimpleMessageBus. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.Amazon.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Amazon **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Amazon.AmazonSQSProcessor ``` ## Summary Processes messages from Amazon SQS queues for SimpleMessageBus. ## Constructors ### .ctor Creates a new instance of the [AmazonSQSProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/AmazonSQSProcessor). #### Syntax ```csharp theme={"dark"} public AmazonSQSProcessor(CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dispatcher` | `CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher` | The [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) to use for processing messages. | | `serviceScopeFactory` | `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory` | The [IServiceScopeFactory](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescopefactory) to use for creating service scopes. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | *dispatcher* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or | | *serviceScopeFactory* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ProcessQueue Processes a message from the SQS queue. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ProcessQueue(Amazon.SQS.Model.Message sqsMessage, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `sqsMessage` | `Amazon.SQS.Model.Message` | The SQS message to process. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance. | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) reference for the asynchronous function. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/index Summary of the CloudNimble.SimpleMessageBus.Dispatch.Amazon Namespace ## Types ### Classes | Name | Summary | | - | - | | [AmazonSQSConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/AmazonSQSConstants) | A set of constants for SimpleMessageBus instances backed by Amazon SQS. | | [AmazonSQSProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/AmazonSQSProcessor) | Processes messages from Amazon SQS queues for SimpleMessageBus. | # AmazonSQSNameResolver Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AmazonSQSNameResolver A [INameResolver](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.inameresolver) for SimpleMessageBus instances backed by Amazon SQS. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.Amazon.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.AmazonSQSNameResolver ``` ## Summary A [INameResolver](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.inameresolver) for SimpleMessageBus instances backed by Amazon SQS. ## Constructors ### .ctor Creates a new instance of the [AmazonSQSNameResolver](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AmazonSQSNameResolver). #### Syntax ```csharp theme={"dark"} public AmazonSQSNameResolver(Microsoft.Extensions.Options.IOptions options, CloudNimble.WebJobs.Extensions.Amazon.SQS.SQSNameResolver baseResolver) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `Microsoft.Extensions.Options.IOptions` | The [AmazonSQSOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Amazon/Core/AmazonSQSOptions) to use for configuration. | | `baseResolver` | `CloudNimble.WebJobs.Extensions.Amazon.SQS.SQSNameResolver` | The base SQS name resolver from WebJobs.Extensions.Amazon. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Resolve Resolves the specified name. #### Syntax ```csharp theme={"dark"} public string Resolve(string name) ``` #### Parameters | Name | Type | Description | | - | - | - | | `name` | `string` | The name to resolve. | #### Returns Type: `string` The resolved value. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * Microsoft.Azure.WebJobs.INameResolver # AzureStorageQueueProcessor Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AzureStorageQueueProcessor Processes messages from Azure Storage Queues and dispatches them to registered message handlers. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.Azure.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.AzureStorageQueueProcessor ``` ## Summary Processes messages from Azure Storage Queues and dispatches them to registered message handlers. ## Remarks This processor integrates with Azure WebJobs to automatically trigger message processing when messages arrive in Azure Storage Queues. It handles message deserialization, lifecycle management, and provides proper logging and dependency injection scope for each message. ## Constructors ### .ctor Initializes a new instance of the [AzureStorageQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AzureStorageQueueProcessor) class. #### Syntax ```csharp theme={"dark"} public AzureStorageQueueProcessor(CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dispatcher` | `CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher` | The message dispatcher to route messages to handlers. | | `serviceScopeFactory` | `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory` | The service scope factory for creating DI scopes per message. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *dispatcher* or *serviceScopeFactory* is null. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ProcessQueue Processes a message from the Azure Storage Queue and dispatches it to registered handlers. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ProcessQueue(Azure.Storage.Queues.Models.QueueMessage queueMessage, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `queueMessage` | `Azure.Storage.Queues.Models.QueueMessage` | The Azure Storage Queue message to process. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance for this processing operation. | #### Returns Type: `System.Threading.Tasks.Task` The processed queue message, which will be moved to the completed queue if configured. #### Remarks This method is triggered automatically by the Azure WebJobs framework when messages arrive. It deserializes the message envelope, sets up processing context, and dispatches to handlers. If processing succeeds, the message is optionally moved to a completion queue. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor # FileSystemQueueProcessor Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/FileSystemQueueProcessor Processes queue items stored in the local file system and dispatches them to all [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageH... ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.FileSystemQueueProcessor ``` ## Summary Processes queue items stored in the local file system and dispatches them to all [IMessageHandler](/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ registered with the DI container. ## Remarks This processor monitors a configured file system directory for new message files and automatically processes them when they appear. It supports three-folder operation: queue (incoming), completed (successfully processed), and error (failed processing). The processor integrates with Azure WebJobs for file system monitoring and automatic triggering. ## Constructors ### .ctor The default constructor called by the Dependency Injection container. #### Syntax ```csharp theme={"dark"} public FileSystemQueueProcessor(Microsoft.Extensions.Options.IOptions options, CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `Microsoft.Extensions.Options.IOptions` | The injected [IOptions\`1](https://learn.microsoft.com/dotnet/api/microsoft.extensions.options.ioptions-1) specifying the options required to leverage the local file system as the SimpleMessageBus backing queue. | | `dispatcher` | `CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher` | The message dispatcher to route messages to handlers. | | `serviceScopeFactory` | `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory` | The Dependency Injection container's [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) instance, so that a "per-request" scope can be created that gives each [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) | | its own set of isolated dependencies. | | | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ProcessQueue Processes a message file when it appears in the queue directory. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ProcessQueue(string messageEnvelopeJson, System.IO.FileSystemEventArgs fileTrigger, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `messageEnvelopeJson` | `string` | The JSON content of the message envelope file. | | `fileTrigger` | `System.IO.FileSystemEventArgs` | The file system event that triggered this processing. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance for this processing operation. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks This method is triggered automatically by the Azure WebJobs framework when files are created or renamed in the queue directory. It deserializes the message and dispatches it to handlers. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor # IMessageDispatcher Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher Defines the required composition of every Dispatcher used by SimpleMessageBus to send [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/Mess... ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher ``` ## Summary Defines the required composition of every Dispatcher used by SimpleMessageBus to send [MessageEnvelope](/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope)MessageEnvelopes\ to the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ registered to handle that message's [Type](/simplemessagebus/api-reference/System/Type). ## Remarks Message dispatchers control how messages are delivered to their handlers. SimpleMessageBus provides two built-in implementations: [OrderedMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/OrderedMessageDispatcher) for sequential processing and [ParallelMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/ParallelMessageDispatcher) for concurrent processing. Custom dispatchers can be implemented for specialized routing or processing logic. ## Methods ### Dispatch Abstract Dispatches an incoming [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) to the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ registered to handle that message's [Type](/simplemessagebus/api-reference/System/Type). #### Syntax ```csharp theme={"dark"} System.Threading.Tasks.Task Dispatch(CloudNimble.SimpleMessageBus.Core.MessageEnvelope messageEnvelope) ``` #### Parameters | Name | Type | Description | | - | - | - | | `messageEnvelope` | `CloudNimble.SimpleMessageBus.Core.MessageEnvelope` | The [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) instance to send to the registered [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\. | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) reference for the asynchronous function. #### Remarks The implementation determines how handlers are invoked - sequentially, in parallel, or using custom logic. All matching handlers (those that declare support for the message type) will be called. # IQueueProcessor Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IQueueProcessor Defines the contract for queue processing components in the SimpleMessageBus system. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor ``` ## Summary Defines the contract for queue processing components in the SimpleMessageBus system. ## Remarks This interface serves as a marker interface for queue processors, allowing for dependency injection registration and service discovery. Concrete implementations handle the specifics of reading messages from different queue providers (Azure, Amazon, FileSystem, etc.) and dispatching them to message handlers. The interface is intentionally empty to allow maximum flexibility in implementation while providing a common contract for the dependency injection system. # IndexedDbQueueProcessor Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IndexedDb/IndexedDbQueueProcessor Processes queue items stored in an IndexedDB database and dispatches them to all [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageH... ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.IndexedDb.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.IndexedDb **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.IndexedDb.IndexedDbQueueProcessor ``` ## Summary Processes queue items stored in an IndexedDB database and dispatches them to all [IMessageHandler](/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ registered with the DI container. ## Remarks This processor is designed for Blazor WebAssembly applications where IndexedDB provides client-side persistent storage for message queuing. It uses a background processing model with a blocking collection to handle messages asynchronously while maintaining proper resource disposal. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public IndexedDbQueueProcessor(CloudNimble.SimpleMessageBus.IndexedDb.Core.SimpleMessageBusDb database, CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `database` | `CloudNimble.SimpleMessageBus.IndexedDb.Core.SimpleMessageBusDb` | - | | `dispatcher` | `CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher` | - | | `serviceScopeFactory` | `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory` | - | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Dispose #### Syntax ```csharp theme={"dark"} public void Dispose() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### LoadQueueItems #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task LoadQueueItems() ``` #### Returns Type: `System.Threading.Tasks.Task` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### Start #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task Start(System.Threading.CancellationToken cancellationToken = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `cancellationToken` | `System.Threading.CancellationToken` | - | #### Returns Type: `System.Threading.Tasks.Task` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor * System.IDisposable # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IndexedDb/index Summary of the CloudNimble.SimpleMessageBus.Dispatch.IndexedDb Namespace ## Types ### Classes | Name | Summary | | - | - | | [IndexedDbQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IndexedDb/IndexedDbQueueProcessor) | Processes queue items stored in an IndexedDB database and dispatches them to all [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ registered with the DI container. | # KafkaProcessor Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Kafka/KafkaProcessor Processes messages from Apache Kafka and dispatches them to registered message handlers. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.Kafka.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Kafka **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Kafka.KafkaProcessor ``` ## Summary Processes messages from Apache Kafka and dispatches them to registered message handlers. ## Remarks This processor integrates with Azure WebJobs to automatically trigger message processing when messages arrive in a Kafka topic. It handles message deserialization, lifecycle management, and provides proper logging and dependency injection scope for each message. Unlike Azure Storage Queues, Kafka does not require explicit message deletion. The WebJobs Kafka extension automatically commits offsets after successful processing. If processing fails, the message will be reprocessed based on the consumer group's offset configuration. ## Examples ```csharp theme={"dark"} Host.CreateDefaultBuilder() .ConfigureServices(services => { services.AddSingleton<IMessageHandler, MyMessageHandler>(); }) .UseKafkaProcessor(options => { options.BrokerList = "localhost:9092"; options.ConsumerGroup = "my-consumer"; }) .UseOrderedMessageDispatcher() .Build() .Run(); ``` ## Constructors ### .ctor Creates a new instance of [KafkaProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Kafka/KafkaProcessor). #### Syntax ```csharp theme={"dark"} public KafkaProcessor(CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory) ``` #### Parameters | Name | Type | Description | | - | - | - | | `dispatcher` | `CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher` | The message dispatcher to route messages to handlers. | | `serviceScopeFactory` | `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory` | Factory for creating DI scopes per message. | #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *dispatcher* or *serviceScopeFactory* is null. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ProcessKafkaMessage Processes a message from the Kafka topic and dispatches it to registered handlers. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task ProcessKafkaMessage(Microsoft.Azure.WebJobs.Extensions.Kafka.KafkaEventData kafkaEvent, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `kafkaEvent` | `Microsoft.Azure.WebJobs.Extensions.Kafka.KafkaEventData` | The Kafka event containing the message payload. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The logger instance for this processing operation. | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) representing the asynchronous operation. #### Remarks This method is triggered automatically by the WebJobs Kafka extension when messages arrive. It deserializes the message envelope, sets up processing context, and dispatches to handlers. The offset is automatically committed after successful processing. If an exception is thrown, the offset is not committed and the message will be reprocessed. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Kafka/index Summary of the CloudNimble.SimpleMessageBus.Dispatch.Kafka Namespace ## Types ### Classes | Name | Summary | | - | - | | [KafkaProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Kafka/KafkaProcessor) | Processes messages from Apache Kafka and dispatches them to registered message handlers. | # OrderedMessageDispatcher Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/OrderedMessageDispatcher An [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) implementation that processes the messages in the order the ... ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.OrderedMessageDispatcher ``` ## Summary An [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) implementation that processes the messages in the order the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ were registered with the Dependency Injection container. ## Remarks This dispatcher ensures that message handlers are invoked sequentially in registration order. This is useful when handler execution order matters, such as when one handler's output affects another handler's behavior. Each handler completes before the next one begins, providing predictable execution flow but potentially slower overall processing compared to parallel dispatching. ## Constructors ### .ctor Initializes a new instance of the [OrderedMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/OrderedMessageDispatcher) class. #### Syntax ```csharp theme={"dark"} public OrderedMessageDispatcher(System.Collections.Generic.IEnumerable messageHandlers) ``` #### Parameters | Name | Type | Description | | - | - | - | | `messageHandlers` | `System.Collections.Generic.IEnumerable` | The collection of message handlers to dispatch to. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Dispatch Sends the [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) to the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)MessageHandlers\ registered to that type, for processing. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task Dispatch(CloudNimble.SimpleMessageBus.Core.MessageEnvelope messageEnvelope) ``` #### Parameters | Name | Type | Description | | - | - | - | | `messageEnvelope` | `CloudNimble.SimpleMessageBus.Core.MessageEnvelope` | The [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) instance to be processed. | #### Returns Type: `System.Threading.Tasks.Task` #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *messageEnvelope* is null. | #### Remarks Handlers are invoked sequentially in the order they were registered with the DI container. If any handler throws an exception, subsequent handlers will not be invoked. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher # ParallelMessageDispatcher Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/ParallelMessageDispatcher An [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) implementation that processes the messages in parallel, rega... ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.ParallelMessageDispatcher ``` ## Summary An [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) implementation that processes the messages in parallel, regardless of the order the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ were registered with the Dependency Injection container. ## Remarks This dispatcher invokes all matching message handlers concurrently using parallel execution. This provides better performance when handlers are independent and don't rely on execution order. However, it should be used carefully when handlers have side effects or shared dependencies that aren't thread-safe. ## Constructors ### .ctor Initializes a new instance of the [ParallelMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/ParallelMessageDispatcher) class. #### Syntax ```csharp theme={"dark"} public ParallelMessageDispatcher(System.Collections.Generic.IEnumerable messageHandlers) ``` #### Parameters | Name | Type | Description | | - | - | - | | `messageHandlers` | `System.Collections.Generic.IEnumerable` | The collection of message handlers to dispatch to. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Methods ### Dispatch Sends the [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) to the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)MessageHandlers\ registered to that type, for processing. #### Syntax ```csharp theme={"dark"} public System.Threading.Tasks.Task Dispatch(CloudNimble.SimpleMessageBus.Core.MessageEnvelope messageEnvelope) ``` #### Parameters | Name | Type | Description | | - | - | - | | `messageEnvelope` | `CloudNimble.SimpleMessageBus.Core.MessageEnvelope` | The [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) instance to be processed. | #### Returns Type: `System.Threading.Tasks.Task` #### Remarks Handlers are invoked concurrently using parallel execution. The method returns when all handlers have completed. If any handler throws an exception, other handlers will continue executing. ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` ## Related APIs * CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher # ISimpleMessageBusFileProcessorFactory Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/ISimpleMessageBusFileProcessorFactory Factory interface for creating [SimpleMessageBusFileProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessor) i... ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Triggers ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Triggers.ISimpleMessageBusFileProcessorFactory ``` ## Summary Factory interface for creating [SimpleMessageBusFileProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessor) instances. This factory pattern allows different FileProcessors to be used for different job functions. ## Methods ### CreateFileProcessor Abstract Create a [SimpleMessageBusFileProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessor) for the specified inputs. #### Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessor CreateFileProcessor(CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessorFactoryContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessorFactoryContext` | The context to use. | #### Returns Type: `CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessor` The [SimpleMessageBusFileProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessor) # SimpleMessageBusFileAttribute Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileAttribute Attribute used to bind a parameter to a file. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Triggers **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileAttribute ``` ## Summary Attribute used to bind a parameter to a file. ## Remarks The method parameter type can be one of the following: ## Constructors ### .ctor Constructs a new instance. #### Syntax ```csharp theme={"dark"} public SimpleMessageBusFileAttribute(string path, System.IO.FileAccess access = 1) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `string` | The file path to bind to. | | `access` | `System.IO.FileAccess` | The [FileAccess](https://learn.microsoft.com/dotnet/api/system.io.fileaccess) to use. | ### .ctor Constructs a new instance. #### Syntax ```csharp theme={"dark"} public SimpleMessageBusFileAttribute(string path, System.IO.FileAccess access, System.IO.FileMode mode) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `string` | The file path to bind to. | | `access` | `System.IO.FileAccess` | The [FileAccess](https://learn.microsoft.com/dotnet/api/system.io.fileaccess) to use. | | `mode` | `System.IO.FileMode` | The [FileMode](https://learn.microsoft.com/dotnet/api/system.io.filemode) to use. | ## Properties ### Access Gets he [FileAccess](https://learn.microsoft.com/dotnet/api/system.io.fileaccess) to use. #### Syntax ```csharp theme={"dark"} public System.IO.FileAccess Access { get; private set; } ``` #### Property Value Type: `System.IO.FileAccess` ### Mode Gets the [FileMode](https://learn.microsoft.com/dotnet/api/system.io.filemode) to use. #### Syntax ```csharp theme={"dark"} public System.IO.FileMode Mode { get; private set; } ``` #### Property Value Type: `System.IO.FileMode` ### Path Gets the file path. #### Syntax ```csharp theme={"dark"} public string Path { get; private set; } ``` #### Property Value Type: `string` # SimpleMessageBusFileProcessor Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessor Default file processor used by [FileTriggerAttribute](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.filetriggerattribute). ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Triggers **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessor ``` ## Summary Default file processor used by [FileTriggerAttribute](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.filetriggerattribute). ## Constructors ### .ctor Constructs a new instance. #### Syntax ```csharp theme={"dark"} public SimpleMessageBusFileProcessor(CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessorFactoryContext context) ``` #### Parameters | Name | Type | Description | | - | - | - | | `context` | `CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessorFactoryContext` | The [SimpleMessageBusFileProcessorFactoryContext](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessorFactoryContext) to use. | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### InstanceId Virtual Gets the current role instance ID. In Azure WebApps, this will be the WEBSITE\_INSTANCE\_ID. In non Azure scenarios, this will default to the Process ID. #### Syntax ```csharp theme={"dark"} public virtual string InstanceId { get; } ``` #### Property Value Type: `string` ### MaxDegreeOfParallelism Virtual Gets the maximum degree of parallelism that will be used when processing files concurrently. #### Syntax ```csharp theme={"dark"} public virtual int MaxDegreeOfParallelism { get; } ``` #### Property Value Type: `int` #### Remarks Files are added to an internal processing queue as file events are detected, and they're processed in parallel based on this setting. ### MaxProcessCount Virtual Gets the maximum number of times file processing will be attempted for a file. #### Syntax ```csharp theme={"dark"} public virtual int MaxProcessCount { get; } ``` #### Property Value Type: `int` ### MaxQueueSize Virtual Gets the bounds on the maximum number of files that can be queued up for processing at one time. When set to -1, the work queue is unbounded. #### Syntax ```csharp theme={"dark"} public virtual int MaxQueueSize { get; } ``` #### Property Value Type: `int` ### StatusFileExtension Virtual Gets the file extension that will be used for the status files that are created for processed files. #### Syntax ```csharp theme={"dark"} public virtual string StatusFileExtension { get; } ``` #### Property Value Type: `string` ## Methods ### Cleanup Virtual Perform any required cleanup. This includes deleting processed files (when [AutoDelete](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.filetriggerattribute.autodelete) is True). #### Syntax ```csharp theme={"dark"} public virtual void Cleanup() ``` ### CleanupProcessedFiles Virtual Clean up any files that have been fully processed #### Syntax ```csharp theme={"dark"} public virtual void CleanupProcessedFiles() ``` ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ProcessFileAsync Virtual Process the file indicated by the specified [FileSystemEventArgs](https://learn.microsoft.com/dotnet/api/system.io.filesystemeventargs). #### Syntax ```csharp theme={"dark"} public virtual System.Threading.Tasks.Task ProcessFileAsync(System.IO.FileSystemEventArgs eventArgs, System.Threading.CancellationToken cancellationToken) ``` #### Parameters | Name | Type | Description | | - | - | - | | `eventArgs` | `System.IO.FileSystemEventArgs` | The [FileSystemEventArgs](https://learn.microsoft.com/dotnet/api/system.io.filesystemeventargs) indicating the file to process. | | `cancellationToken` | `System.Threading.CancellationToken` | The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use. | #### Returns Type: `System.Threading.Tasks.Task` A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) that returns true if the file was processed successfully, false otherwise. ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ShouldProcessFile Virtual Determines whether the specified file should be processed. #### Syntax ```csharp theme={"dark"} public virtual bool ShouldProcessFile(string filePath) ``` #### Parameters | Name | Type | Description | | - | - | - | | `filePath` | `string` | The candidate file for processing. | #### Returns Type: `bool` True if the file should be processed, false otherwise. ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SimpleMessageBusFileProcessorFactoryContext Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessorFactoryContext Context input for [ISimpleMessageBusFileProcessorFactory](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/ISimpleMessageBusFileProcessorFactory) ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Triggers **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessorFactoryContext ``` ## Summary Context input for [ISimpleMessageBusFileProcessorFactory](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/ISimpleMessageBusFileProcessorFactory) ## Constructors ### .ctor Constructs a new instance #### Syntax ```csharp theme={"dark"} public SimpleMessageBusFileProcessorFactoryContext(CloudNimble.SimpleMessageBus.Core.FileSystemOptions options, CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileTriggerAttribute attribute, string queueFolder, Microsoft.Azure.WebJobs.Host.Executors.ITriggeredFunctionExecutor executor, Microsoft.Extensions.Logging.ILogger logger) ``` #### Parameters | Name | Type | Description | | - | - | - | | `options` | `CloudNimble.SimpleMessageBus.Core.FileSystemOptions` | The [FilesOptions](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.files.filesoptions) | | `attribute` | `CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileTriggerAttribute` | The [SimpleMessageBusFileTriggerAttribute](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileTriggerAttribute) | | `queueFolder` | `string` | - | | `executor` | `Microsoft.Azure.WebJobs.Host.Executors.ITriggeredFunctionExecutor` | The function executor. | | `logger` | `Microsoft.Extensions.Logging.ILogger` | The [ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger). | ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### Attribute Gets the [SimpleMessageBusFileTriggerAttribute](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileTriggerAttribute) #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileTriggerAttribute Attribute { get; private set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileTriggerAttribute` ### Executor Gets the function executor #### Syntax ```csharp theme={"dark"} public Microsoft.Azure.WebJobs.Host.Executors.ITriggeredFunctionExecutor Executor { get; private set; } ``` #### Property Value Type: `Microsoft.Azure.WebJobs.Host.Executors.ITriggeredFunctionExecutor` ### Logger Gets the [ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger). #### Syntax ```csharp theme={"dark"} public Microsoft.Extensions.Logging.ILogger Logger { get; private set; } ``` #### Property Value Type: `Microsoft.Extensions.Logging.ILogger` ### Options Gets the [FilesOptions](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.files.filesoptions) #### Syntax ```csharp theme={"dark"} public CloudNimble.SimpleMessageBus.Core.FileSystemOptions Options { get; private set; } ``` #### Property Value Type: `CloudNimble.SimpleMessageBus.Core.FileSystemOptions` ### QueueFolder Gets the queue folder. #### Syntax ```csharp theme={"dark"} public string QueueFolder { get; private set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SimpleMessageBusFileTriggerAttribute Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileTriggerAttribute Attribute used to mark a job function that should be invoked based on file events. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll **Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Triggers **Inheritance:** System.Attribute ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileTriggerAttribute ``` ## Summary Attribute used to mark a job function that should be invoked based on file events. ## Remarks The method parameter type can be one of the following: ## Constructors ### .ctor Constructs a new instance. #### Syntax ```csharp theme={"dark"} public SimpleMessageBusFileTriggerAttribute(string path, string filter, System.IO.WatcherChangeTypes changeTypes = 1, bool autoDelete = false) ``` #### Parameters | Name | Type | Description | | - | - | - | | `path` | `string` | The root path that this trigger is configured to watch for files on. | | `filter` | `string` | The optional file filter that will be used. | | `changeTypes` | `System.IO.WatcherChangeTypes` | The [WatcherChangeTypes](https://learn.microsoft.com/dotnet/api/system.io.watcherchangetypes) that will be used by the file watcher. The Default is Created. | | `autoDelete` | `bool` | True if processed files should be deleted automatically, false otherwise. The default is False. | ## Properties ### AutoDelete Gets a value indicating whether files should be automatically deleted after they are successfully processed. When set to true, all files including any companion files starting with the target file name will be deleted when the file is successfully processed. #### Syntax ```csharp theme={"dark"} public bool AutoDelete { get; private set; } ``` #### Property Value Type: `bool` ### ChangeTypes Gets the [WatcherChangeTypes](https://learn.microsoft.com/dotnet/api/system.io.watcherchangetypes) that will be used by the file watcher. #### Syntax ```csharp theme={"dark"} public System.IO.WatcherChangeTypes ChangeTypes { get; private set; } ``` #### Property Value Type: `System.IO.WatcherChangeTypes` ### Filter Gets the optional file filter that will be used. #### Syntax ```csharp theme={"dark"} public string Filter { get; private set; } ``` #### Property Value Type: `string` ### Path Gets the root path that this trigger is configured to watch for files on. #### Syntax ```csharp theme={"dark"} public string Path { get; private set; } ``` #### Property Value Type: `string` ### RootPath Gets the root path that this trigger is configured to watch for files on. #### Syntax ```csharp theme={"dark"} public string RootPath { get; } ``` #### Property Value Type: `string` # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/index Summary of the CloudNimble.SimpleMessageBus.Dispatch.Triggers Namespace ## Types ### Classes | Name | Summary | | - | - | | [SimpleMessageBusFileProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessor) | Default file processor used by [FileTriggerAttribute](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.filetriggerattribute). | | [SimpleMessageBusFileProcessorFactoryContext](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessorFactoryContext) | Context input for [ISimpleMessageBusFileProcessorFactory](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/ISimpleMessageBusFileProcessorFactory) | | [SimpleMessageBusFileAttribute](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileAttribute) | Attribute used to bind a parameter to a file. | | [SimpleMessageBusFileTriggerAttribute](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileTriggerAttribute) | Attribute used to mark a job function that should be invoked based on file events. | ### Interfaces | Name | Summary | | - | - | | [ISimpleMessageBusFileProcessorFactory](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/ISimpleMessageBusFileProcessorFactory) | Factory interface for creating [SimpleMessageBusFileProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessor) instances. This factory pattern allows different FileProcessors to be used for different job functions. | # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/index Summary of the CloudNimble.SimpleMessageBus.Dispatch Namespace ## Types ### Classes | Name | Summary | | - | - | | [OrderedMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/OrderedMessageDispatcher) | An [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) implementation that processes the messages in the order the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ were registered with the Dependency Injection container. | | [ParallelMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/ParallelMessageDispatcher) | An [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) implementation that processes the messages in parallel, regardless of the order the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ were registered with the Dependency Injection container. | | [AmazonSQSNameResolver](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AmazonSQSNameResolver) | A [INameResolver](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.inameresolver) for SimpleMessageBus instances backed by Amazon SQS. | | [AzureStorageQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AzureStorageQueueProcessor) | Processes messages from Azure Storage Queues and dispatches them to registered message handlers. | | [FileSystemQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/FileSystemQueueProcessor) | Processes queue items stored in the local file system and dispatches them to all [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ registered with the DI container. | ### Interfaces | Name | Summary | | - | - | | [IMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IMessageDispatcher) | Defines the required composition of every Dispatcher used by SimpleMessageBus to send [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope)MessageEnvelopes\ to the [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ registered to handle that message's [Type](/simplemessagebus/api-reference/System/Type). | | [IQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/IQueueProcessor) | Defines the contract for queue processing components in the SimpleMessageBus system. | # IndexedDbConstants Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbConstants A set of helpers to convert file system-related magic strings to compiled references. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.IndexedDb.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.IndexedDb.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.IndexedDb.Core.IndexedDbConstants ``` ## Summary A set of helpers to convert file system-related magic strings to compiled references. # IndexedDbOptions Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbOptions Specifies the options required to leverage a browser's IndexedDB instance as the SimpleMessageBus backing queue. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.IndexedDb.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.IndexedDb.Core **Inheritance:** System.Object ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.IndexedDb.Core.IndexedDbOptions ``` ## Summary Specifies the options required to leverage a browser's IndexedDB instance as the SimpleMessageBus backing queue. ## Remarks These options configure the IndexedDB database and object store names used for message queuing in Blazor WebAssembly applications. The default values follow SimpleMessageBus conventions and can be customized for specific application requirements. ## Constructors ### .ctor The default constructor, which sets the default values equal to the values specified in [IndexedDbConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbConstants). #### Syntax ```csharp theme={"dark"} public IndexedDbOptions() ``` ### .ctor Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public Object() ``` ## Properties ### CompletedQueueName The IndexedDb table where successfully-processed queue items will be moved to upon completion. Defaults to [IndexedDbConstants.Completed](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbConstants#completed). #### Syntax ```csharp theme={"dark"} public string CompletedQueueName { get; set; } ``` #### Property Value Type: `string` ### DatabaseName The name of the Database inside IndexedDb where the queue tables will be stored. Defaults to 'SimpleMessageBus'. #### Syntax ```csharp theme={"dark"} public string DatabaseName { get; set; } ``` #### Property Value Type: `string` ### ErrorQueueName The IndexedDb table where failed items will be stored while they are waiting to be analyzed and reprocessed. Defaults to [IndexedDbConstants.Error](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbConstants#error). #### Syntax ```csharp theme={"dark"} public string ErrorQueueName { get; set; } ``` #### Property Value Type: `string` ### QueueName The IndexedDb table where items will be stored while they are waiting to be processed. Defaults to [IndexedDbConstants.Queue](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbConstants#queue). #### Syntax ```csharp theme={"dark"} public string QueueName { get; set; } ``` #### Property Value Type: `string` ## Methods ### Equals Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual bool Equals(object obj) ``` #### Parameters | Name | Type | Description | | - | - | - | | `obj` | `object?` | - | #### Returns Type: `bool` ### Equals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool Equals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### GetHashCode Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual int GetHashCode() ``` #### Returns Type: `int` ### GetType Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public System.Type GetType() ``` #### Returns Type: `System.Type` ### MemberwiseClone Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} protected internal object MemberwiseClone() ``` #### Returns Type: `object` ### ReferenceEquals Inherited Inherited from `object` #### Syntax ```csharp theme={"dark"} public static bool ReferenceEquals(object objA, object objB) ``` #### Parameters | Name | Type | Description | | - | - | - | | `objA` | `object?` | - | | `objB` | `object?` | - | #### Returns Type: `bool` ### ToString Inherited Virtual Inherited from `object` #### Syntax ```csharp theme={"dark"} public virtual string ToString() ``` #### Returns Type: `string?` # SimpleMessageBusDb Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/SimpleMessageBusDb Represents the IndexedDB database structure for SimpleMessageBus in Blazor WebAssembly applications. ## Definition **Assembly:** CloudNimble.SimpleMessageBus.IndexedDb.Core.dll **Namespace:** CloudNimble.SimpleMessageBus.IndexedDb.Core **Inheritance:** CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase ## Syntax ```csharp theme={"dark"} CloudNimble.SimpleMessageBus.IndexedDb.Core.SimpleMessageBusDb ``` ## Summary Represents the IndexedDB database structure for SimpleMessageBus in Blazor WebAssembly applications. ## Remarks This class defines the IndexedDB schema used for client-side message queuing in Blazor WebAssembly. It provides three object stores for managing message lifecycle: Queue (pending), Completed (successful), and Failed (error) processing states. ## Constructors ### .ctor #### Syntax ```csharp theme={"dark"} public SimpleMessageBusDb(Microsoft.JSInterop.IJSRuntime jsRuntime, Microsoft.Extensions.Options.IOptions indexedDbOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `jsRuntime` | `Microsoft.JSInterop.IJSRuntime` | - | | `indexedDbOptions` | `Microsoft.Extensions.Options.IOptions` | - | ## Properties ### Completed Gets or sets the object store for successfully processed messages. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore Completed { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore` ### Failed Gets or sets the object store for messages that failed processing. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore Failed { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore` ### Queue Gets or sets the object store for messages pending processing. #### Syntax ```csharp theme={"dark"} public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore Queue { get; set; } ``` #### Property Value Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore` # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/index Summary of the CloudNimble.SimpleMessageBus.IndexedDb.Core Namespace ## Types ### Classes | Name | Summary | | - | - | | [IndexedDbConstants](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbConstants) | A set of helpers to convert file system-related magic strings to compiled references. | | [IndexedDbOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbOptions) | Specifies the options required to leverage a browser's IndexedDB instance as the SimpleMessageBus backing queue. | | [SimpleMessageBusDb](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/SimpleMessageBusDb) | Represents the IndexedDB database structure for SimpleMessageBus in Blazor WebAssembly applications. | # WebAssemblyHostBuilder Source: https://easyaf.dev/simplemessagebus/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/WebAssemblyHostBuilder Extension methods for WebAssemblyHostBuilder from Microsoft.AspNetCore.Components.WebAssembly ## Definition **Assembly:** Microsoft.AspNetCore.Components.WebAssembly.dll **Namespace:** Microsoft.AspNetCore.Components.WebAssembly.Hosting ## Syntax ```csharp theme={"dark"} Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder ``` ## Summary This type is defined in Microsoft.AspNetCore.Components.WebAssembly. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.webassembly.hosting.webassemblyhostbuilder) for more information about the rest of the API. ## Methods ### UseIndexedDbMessagePublisher Extension Extension method from `Microsoft.AspNetCore.Components.WebAssembly.Hosting.SimpleMessageBus_Publish_IndexedDb_WebAssemblyHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static void UseIndexedDbMessagePublisher(Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder builder, string configSectionName = "SimpleMessageBus:IndexedDb", System.Action indexedDbOptions = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder` | - | | `configSectionName` | `string` | - | | `indexedDbOptions` | `System.Action` | - | # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/index Summary of the Microsoft.AspNetCore.Components.WebAssembly.Hosting Namespace ## Types # IWebJobsBuilder Source: https://easyaf.dev/simplemessagebus/api-reference/Microsoft/Azure/WebJobs/IWebJobsBuilder Extension methods for IWebJobsBuilder from Microsoft.Azure.WebJobs.Host ## Definition **Assembly:** Microsoft.Azure.WebJobs.Host.dll **Namespace:** Microsoft.Azure.WebJobs ## Syntax ```csharp theme={"dark"} Microsoft.Azure.WebJobs.IWebJobsBuilder ``` ## Summary This type is defined in Microsoft.Azure.WebJobs.Host. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.iwebjobsbuilder) for more information about the rest of the API. ## Methods ### AddSimpleMessageBusFiles Extension Extension method from `CloudNimble.SimpleMessageBus.Dispatch.Triggers.Files_IWebJobsBuilderExtensions` Adds the Files extension to the provided [IWebJobsBuilder](/simplemessagebus/api-reference/Microsoft/Azure/WebJobs/IWebJobsBuilder). #### Syntax ```csharp theme={"dark"} public static Microsoft.Azure.WebJobs.IWebJobsBuilder AddSimpleMessageBusFiles(Microsoft.Azure.WebJobs.IWebJobsBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Azure.WebJobs.IWebJobsBuilder` | The [IWebJobsBuilder](/simplemessagebus/api-reference/Microsoft/Azure/WebJobs/IWebJobsBuilder) to configure. | #### Returns Type: `Microsoft.Azure.WebJobs.IWebJobsBuilder` ### AddSimpleMessageBusFiles Extension Extension method from `CloudNimble.SimpleMessageBus.Dispatch.Triggers.Files_IWebJobsBuilderExtensions` Adds the Files extension to the provided [IWebJobsBuilder](/simplemessagebus/api-reference/Microsoft/Azure/WebJobs/IWebJobsBuilder). #### Syntax ```csharp theme={"dark"} public static Microsoft.Azure.WebJobs.IWebJobsBuilder AddSimpleMessageBusFiles(Microsoft.Azure.WebJobs.IWebJobsBuilder builder, System.Action configure) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Azure.WebJobs.IWebJobsBuilder` | The [IWebJobsBuilder](/simplemessagebus/api-reference/Microsoft/Azure/WebJobs/IWebJobsBuilder) to configure. | | `configure` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) to configure the provided [FilesOptions](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.files.filesoptions). | #### Returns Type: `Microsoft.Azure.WebJobs.IWebJobsBuilder` # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/Microsoft/Azure/WebJobs/index Summary of the Microsoft.Azure.WebJobs Namespace ## Types # IHostBuilder Source: https://easyaf.dev/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder Extension methods for IHostBuilder from Microsoft.Extensions.Hosting.Abstractions ## Definition **Assembly:** Microsoft.Extensions.Hosting.Abstractions.dll **Namespace:** Microsoft.Extensions.Hosting ## Syntax ```csharp theme={"dark"} Microsoft.Extensions.Hosting.IHostBuilder ``` ## Summary This type is defined in Microsoft.Extensions.Hosting.Abstractions. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostbuilder) for more information about the rest of the API. ## Methods ### UseAmazonSQSMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_Amazon_IHostBuilderExtensions` Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the [AmazonSQSMessagePublisher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Publish/Amazon/AmazonSQSMessagePublisher) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseAmazonSQSMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_Amazon_IHostBuilderExtensions` Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the [AmazonSQSMessagePublisher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Publish/Amazon/AmazonSQSMessagePublisher) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action amazonSQSOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `amazonSQSOptions` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) that gives you a fluent interface for configuring the options for a queue backed by Amazon SQS. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseAmazonSQSProcessor Extension Extension method from `Microsoft.Extensions.Hosting.DispatchAmazon_IHostBuilderExtensions` Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the [AmazonSQSProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/AmazonSQSProcessor) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseAmazonSQSProcessor Extension Extension method from `Microsoft.Extensions.Hosting.DispatchAmazon_IHostBuilderExtensions` Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the [AmazonSQSProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Amazon/AmazonSQSProcessor) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action amazonSQSOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `amazonSQSOptions` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) that gives you a fluent interface for configuring the options for a queue backed by Amazon SQS. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseAzureStorageQueueMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseAzureStorageQueueMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action azureQueueOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `azureQueueOptions` | `System.Action` | - | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseAzureStorageQueueProcessor Extension Extension method from `Microsoft.Extensions.Hosting.IHostBuilderExtensions` Configures SimpleMessageBus to use Azure Storage Queues as the backing queue and registers the [AzureStorageQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AzureStorageQueueProcessor) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseAzureStorageQueueProcessor Extension Extension method from `Microsoft.Extensions.Hosting.IHostBuilderExtensions` Configures SimpleMessageBus to use Azure Storage Queues as the backing queue and registers the [AzureStorageQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AzureStorageQueueProcessor) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action azureQueueOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `azureQueueOptions` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) that gives you a fluent interface for configuring the options for a queue backed by Azure Queue Storage. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseFileSystemMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseFileSystemMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action fileSystemOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `fileSystemOptions` | `System.Action` | - | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseFileSystemQueueProcessor Extension Extension method from `Microsoft.Extensions.Hosting.FileSystem_IHostBuilderExtensions` Configures SimpleMessageBus to use the local file system as the backing queue and registers the [FileSystemQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/FileSystemQueueProcessor) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseFileSystemQueueProcessor Extension Extension method from `Microsoft.Extensions.Hosting.FileSystem_IHostBuilderExtensions` Configures SimpleMessageBus to use the local file system as the backing queue and registers the [FileSystemQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/FileSystemQueueProcessor) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action fileSystemOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `fileSystemOptions` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) that gives you a fluent interface for configuring the options for a queue backed by the file system.. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseIndexedDbMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IndexedDb_IHostBuilderExtensions` #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseIndexedDbMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, string configSectionName = "SimpleMessageBus:IndexedDb", System.Action indexedDbOptions = null) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `configSectionName` | `string` | The name of the [ConfigurationSection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.configurationsection) to load the [IndexedDbOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbOptions) from. Defaults to 'SimpleMessageBus:IndexedDb'. | | `indexedDbOptions` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) lambda that allows you to set the [IndexedDbOptions](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/IndexedDb/Core/IndexedDbOptions) inline. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent configuration. ### UseKafkaMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_Kafka_IHostBuilderExtensions` Configures SimpleMessageBus to publish messages to Apache Kafka. Reads configuration from the "KafkaOptions" section of IConfiguration. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseKafkaMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *builder* is null. | #### Examples ```csharp theme={"dark"} Host.CreateDefaultBuilder() .UseKafkaMessagePublisher() .Build() .Run(); ``` ### UseKafkaMessagePublisher Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_Kafka_IHostBuilderExtensions` Configures SimpleMessageBus to publish messages to Apache Kafka. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseKafkaMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action kafkaOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `kafkaOptions` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) that provides a fluent interface for configuring Kafka options. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *builder* or *kafkaOptions* is null. | #### Examples ```csharp theme={"dark"} Host.CreateDefaultBuilder() .UseKafkaMessagePublisher(options => { options.BrokerList = "localhost:9092"; options.TopicName = "my-events"; }) .Build() .Run(); ``` ### UseKafkaProcessor Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Dispatch_Kafka_IHostBuilderExtensions` Configures SimpleMessageBus to process messages from Apache Kafka and registers the [KafkaProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Kafka/KafkaProcessor) with the DI container. Reads configuration from the "KafkaOptions" section of IConfiguration. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseKafkaProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *builder* is null. | #### Examples ```csharp theme={"dark"} Host.CreateDefaultBuilder() .UseKafkaProcessor() .UseOrderedMessageDispatcher() .Build() .Run(); ``` ### UseKafkaProcessor Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Dispatch_Kafka_IHostBuilderExtensions` Configures SimpleMessageBus to process messages from Apache Kafka and registers the [KafkaProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Kafka/KafkaProcessor) with the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseKafkaProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action kafkaOptions) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | | `kafkaOptions` | `System.Action` | An [Action\`1](https://learn.microsoft.com/dotnet/api/system.action-1) that provides a fluent interface for configuring Kafka options. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. #### Exceptions | Exception | Description | | - | - | | `ArgumentNullException` | Thrown when *builder* or *kafkaOptions* is null. | #### Examples ```csharp theme={"dark"} Host.CreateDefaultBuilder() .ConfigureServices(services => { services.AddSingleton<IMessageHandler, MyMessageHandler>(); }) .UseKafkaProcessor(options => { options.BrokerList = "localhost:9092"; options.ConsumerGroup = "my-consumer"; }) .UseOrderedMessageDispatcher() .Build() .Run(); ``` ### UseOrderedMessageDispatcher Extension Extension method from `Microsoft.Extensions.Hosting.IHostBuilderExtensions` Configures SimpleMessageBus to use the [OrderedMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/OrderedMessageDispatcher), which processes registered [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ in series based on the order they were registered in the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseOrderedMessageDispatcher(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseParallelMessageDispatcher Extension Extension method from `Microsoft.Extensions.Hosting.IHostBuilderExtensions` Configures SimpleMessageBus to use the [ParallelMessageDispatcher](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/ParallelMessageDispatcher), which processes registered [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\ in parallel regardless of the order the order they were registered in the DI container. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseParallelMessageDispatcher(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. ### UseSimpleMessageBusLifetime Extension Extension method from `Microsoft.Extensions.Hosting.SimpleMessageBus_Hosting_IHostBuilderExtensions` Configures SimpleMessageBus to use either the [WindowsServiceLifetime](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.windowsservices.windowsservicelifetime) or the [ConsoleLifetime](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.internal.consolelifetime) depending on the currently-running context. #### Syntax ```csharp theme={"dark"} public static Microsoft.Extensions.Hosting.IHostBuilder UseSimpleMessageBusLifetime(Microsoft.Extensions.Hosting.IHostBuilder builder) ``` #### Parameters | Name | Type | Description | | - | - | - | | `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance to extend. | #### Returns Type: `Microsoft.Extensions.Hosting.IHostBuilder` The [IHostBuilder](/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance being configured, for fluent interaction. #### Remarks This method automatically detects whether the application is running as a Windows Service and configures the appropriate lifetime management. This enables the same application to run seamlessly in both development (console) and production (service) environments. # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/Microsoft/Extensions/Hosting/index Summary of the Microsoft.Extensions.Hosting Namespace ## Types # ConcurrentDictionary Source: https://easyaf.dev/simplemessagebus/api-reference/System/Collections/Concurrent/ConcurrentDictionary Extension methods for ConcurrentDictionary from System.Collections.Concurrent ## Definition **Assembly:** System.Collections.Concurrent.dll **Namespace:** System.Collections.Concurrent ## Syntax ```csharp theme={"dark"} System.Collections.Concurrent.ConcurrentDictionary ``` ## Summary This type is defined in System.Collections.Concurrent. ## Remarks See \[Microsoft documentation]\([https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary\{system.string](https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary\{system.string), system.object}) for more information about the rest of the API. ## Methods ### Filter Extension Extension method from `System.Collections.Concurrent.SimpleMessageBus_ConcurrentDictionaryExtensions` Filters the metadata [ConcurrentDictionary\`2](https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2) to exclude keys ending with "-Status" or "-Timestamp". #### Syntax ```csharp theme={"dark"} public static System.Collections.Concurrent.ConcurrentDictionary Filter(System.Collections.Concurrent.ConcurrentDictionary metadata) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `System.Collections.Concurrent.ConcurrentDictionary` | The metadata dictionary to filter. | #### Returns Type: `System.Collections.Concurrent.ConcurrentDictionary` A new concurrent dictionary containing only the non-status entries. #### Remarks This method helps filter out handler execution metadata when copying metadata between events, ensuring that the execution status of one event doesn't affect another. ### FilterAndCombine Extension Extension method from `System.Collections.Concurrent.SimpleMessageBus_ConcurrentDictionaryExtensions` Filters the metadata dictionary to exclude keys ending with "-Status" and combines it with the payload dictionary. #### Syntax ```csharp theme={"dark"} public static System.Collections.Generic.Dictionary FilterAndCombine(System.Collections.Concurrent.ConcurrentDictionary metadata, System.Collections.Generic.Dictionary payload) ``` #### Parameters | Name | Type | Description | | - | - | - | | `metadata` | `System.Collections.Concurrent.ConcurrentDictionary` | The metadata dictionary to filter and combine. | | `payload` | `System.Collections.Generic.Dictionary` | The payload dictionary to combine with the filtered metadata. | #### Returns Type: `System.Collections.Generic.Dictionary` A new dictionary containing the combined entries from the payload and filtered metadata. #### Remarks This method helps filter out handler execution status from the metadata when constructing new messages or passing metadata between events in a processing chain. # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/System/Collections/Concurrent/index Summary of the System.Collections.Concurrent Namespace ## Types # Type Source: https://easyaf.dev/simplemessagebus/api-reference/System/Type Extension methods for Type from System.Runtime ## Definition **Assembly:** System.Runtime.dll **Namespace:** System ## Syntax ```csharp theme={"dark"} System.Type ``` ## Summary This type is defined in System.Runtime. ## Remarks See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.type) for more information about the rest of the API. ## Methods ### SimpleAssemblyQualifiedName Extension Extension method from `System.TypeExtensions` Guarantees the creation of an AssemblyQualifiedName that does not contain version or key details. That way when AssemblyVersions are incremented, the system will still attempt to process the [IMessage](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessage). #### Syntax ```csharp theme={"dark"} public static string SimpleAssemblyQualifiedName(System.Type type) ``` #### Parameters | Name | Type | Description | | - | - | - | | `type` | `System.Type` | - | #### Returns Type: `string` A string containing the *type* name in the format "FullTypeName, SimpleAssemblyName". # Overview Source: https://easyaf.dev/simplemessagebus/api-reference/System/index Summary of the System Namespace ## Types # Configuration Guide Source: https://easyaf.dev/simplemessagebus/guides/configuration Complete guide to configuring SimpleMessageBus in your application This guide covers all aspects of configuring SimpleMessageBus in your .NET applications, from basic setup to advanced scenarios. ## Basic Configuration Configure SimpleMessageBus in your `Program.cs` file: ```csharp theme={"dark"} using SimpleMessageBus.Publish.Azure.Extensions; using SimpleMessageBus.Dispatch.Azure.Extensions; var builder = WebApplication.CreateBuilder(args); // Configure publisher builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); options.DefaultQueueName = "messages"; }); // Configure dispatcher builder.Services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); options.MaxConcurrentMessages = 32; options.PollingInterval = TimeSpan.FromSeconds(5); }); // Register message handlers builder.Services.AddScoped(); var app = builder.Build(); app.Run(); ``` For console applications, use the generic host: ```csharp theme={"dark"} using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; var builder = Host.CreateApplicationBuilder(args); // Configure SimpleMessageBus builder.Services.AddSimpleMessageBusFileSystemPublisher(options => { options.RootPath = Path.Combine(Directory.GetCurrentDirectory(), "messages"); }); builder.Services.AddSimpleMessageBusFileSystemDispatcher(options => { options.RootPath = Path.Combine(Directory.GetCurrentDirectory(), "messages"); }); // Register handlers builder.Services.AddScoped(); var host = builder.Build(); await host.RunAsync(); ``` ## Provider-Specific Configuration ### Azure Storage Queue ```csharp theme={"dark"} services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = "DefaultEndpointsProtocol=https;AccountName=..."; options.DefaultQueueName = "messages"; options.CreateQueuesAutomatically = true; }); services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = "DefaultEndpointsProtocol=https;AccountName=..."; options.DefaultQueueName = "messages"; options.PollingInterval = TimeSpan.FromSeconds(5); options.MaxConcurrentMessages = 32; options.VisibilityTimeout = TimeSpan.FromMinutes(5); }); ``` ```csharp theme={"dark"} services.AddSimpleMessageBusAzureStoragePublisher(options => { options.AccountName = "mystorageaccount"; // No connection string - uses managed identity options.DefaultQueueName = "messages"; }); ``` ```csharp theme={"dark"} services.AddSingleton(); public class CustomQueueNameResolver : IQueueNameResolver { public string ResolveQueueName(T message) where T : IMessage { return $"{typeof(T).Name.ToLowerInvariant()}-queue"; } } ``` ### Amazon SQS ```csharp theme={"dark"} services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = "us-east-1"; options.AccessKey = "AKIAIOSFODNN7EXAMPLE"; options.SecretKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"; options.DefaultQueueName = "messages"; }); ``` ```csharp theme={"dark"} services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = "us-east-1"; options.UseInstanceProfile = true; // Use attached IAM role options.DefaultQueueName = "messages"; }); ``` ```csharp theme={"dark"} services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.DefaultQueueName = "messages.fifo"; options.UseFifoQueues = true; options.MessageGroupId = "default"; options.ContentBasedDeduplication = true; }); ``` ### File System ```csharp theme={"dark"} services.AddSimpleMessageBusFileSystemPublisher(options => { options.RootPath = @"C:\MessageQueue"; options.CreateDirectoriesAutomatically = true; }); services.AddSimpleMessageBusFileSystemDispatcher(options => { options.RootPath = @"C:\MessageQueue"; options.PollingInterval = TimeSpan.FromSeconds(1); options.ProcessedDirectory = "processed"; options.ErrorDirectory = "errors"; }); ``` ```csharp theme={"dark"} [FunctionName("ProcessMessage")] public async Task ProcessFileMessage( [SimpleMessageBusFileTrigger("messages")] MessageEnvelope envelope, ILogger log) { await _dispatcher.Dispatch(envelope); } ``` ### IndexedDB (Blazor WebAssembly) ```csharp theme={"dark"} // Program.cs in Blazor WebAssembly builder.Services.AddSimpleMessageBusIndexedDbPublisher(options => { options.DatabaseName = "MessageBusDB"; options.DatabaseVersion = 1; }); builder.Services.AddSimpleMessageBusIndexedDbDispatcher(options => { options.DatabaseName = "MessageBusDB"; options.PollingInterval = TimeSpan.FromSeconds(2); }); ``` ## Environment-Based Configuration Configure different providers for different environments: ```csharp theme={"dark"} var builder = WebApplication.CreateBuilder(args); if (builder.Environment.IsDevelopment()) { // Use file system in development builder.Services.AddSimpleMessageBusFileSystemPublisher(options => { options.RootPath = Path.Combine(Directory.GetCurrentDirectory(), "dev-messages"); }); builder.Services.AddSimpleMessageBusFileSystemDispatcher(options => { options.RootPath = Path.Combine(Directory.GetCurrentDirectory(), "dev-messages"); options.PollingInterval = TimeSpan.FromSeconds(1); }); } else if (builder.Environment.IsStaging()) { // Use Azure Storage in staging builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("StagingStorage"); options.DefaultQueueName = "staging-messages"; }); builder.Services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("StagingStorage"); options.DefaultQueueName = "staging-messages"; }); } else // Production { // Use Amazon SQS in production builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = builder.Configuration["AWS:Region"]; options.UseInstanceProfile = true; options.DefaultQueueName = "production-messages"; }); builder.Services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.Region = builder.Configuration["AWS:Region"]; options.UseInstanceProfile = true; options.DefaultQueueName = "production-messages"; }); } ``` Use feature flags to control provider selection: ```csharp theme={"dark"} var useAmazonSQS = builder.Configuration.GetValue("Features:UseAmazonSQS"); var useHighThroughput = builder.Configuration.GetValue("Features:HighThroughput"); if (useAmazonSQS) { builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { builder.Configuration.GetSection("AmazonSQS").Bind(options); }); } else { builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { builder.Configuration.GetSection("AzureStorage").Bind(options); }); } // Adjust concurrency based on feature flag builder.Services.Configure(options => { options.MaxConcurrentMessages = useHighThroughput ? 64 : 16; }); ``` ## Message Handler Registration Register individual handlers explicitly: ```csharp theme={"dark"} // Register individual handlers services.AddScoped(); services.AddScoped(); services.AddScoped(); ``` **Best for**: Small projects with few handlers. Automatically discover and register handlers: ```csharp theme={"dark"} // Register all handlers from current assembly services.Scan(scan => scan .FromAssemblyOf() .AddClasses(classes => classes.AssignableTo()) .As() .WithScopedLifetime()); // Register handlers from multiple assemblies services.Scan(scan => scan .FromAssemblies( Assembly.GetExecutingAssembly(), Assembly.GetAssembly(typeof(ExternalHandler))) .AddClasses(classes => classes.AssignableTo()) .As() .WithScopedLifetime()); ``` **Best for**: Large projects with many handlers. Register handlers based on configuration: ```csharp theme={"dark"} // Register handlers based on configuration if (builder.Configuration.GetValue("Features:OrderProcessing")) { services.AddScoped(); services.AddScoped(); } if (builder.Configuration.GetValue("Features:PaymentProcessing")) { services.AddScoped(); services.AddScoped(); } ``` **Best for**: Feature flag-based deployments. ## Advanced Configuration ### Multiple Providers Use different providers for different message types: ```csharp theme={"dark"} // Configure multiple publishers with names services.AddSimpleMessageBusAzureStoragePublisher("orders", options => { options.ConnectionString = azureConnectionString; options.DefaultQueueName = "orders"; }); services.AddSimpleMessageBusAmazonSQSPublisher("payments", options => { options.Region = "us-east-1"; options.UseInstanceProfile = true; options.DefaultQueueName = "payments"; }); // Use named publishers public class OrderService { private readonly IMessagePublisher _orderPublisher; private readonly IMessagePublisher _paymentPublisher; public OrderService( [FromKeyedServices("orders")] IMessagePublisher orderPublisher, [FromKeyedServices("payments")] IMessagePublisher paymentPublisher) { _orderPublisher = orderPublisher; _paymentPublisher = paymentPublisher; } public async Task ProcessOrderAsync(Order order) { await _orderPublisher.PublishAsync(new OrderCreatedMessage { ... }); await _paymentPublisher.PublishAsync(new ProcessPaymentMessage { ... }); } } ``` ### Custom Dispatcher Configuration Configure message dispatching behavior: ```csharp theme={"dark"} // Parallel dispatcher (default) services.AddSimpleMessageBusParallelDispatcher(options => { options.MaxConcurrency = Environment.ProcessorCount * 2; options.BatchSize = 10; }); // Ordered dispatcher services.AddSimpleMessageBusOrderedDispatcher(); // Custom dispatcher services.AddScoped(); ``` ### Serialization Configuration Customize JSON serialization: ```csharp theme={"dark"} services.Configure(options => { options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; options.WriteIndented = true; options.Converters.Add(new JsonStringEnumConverter()); }); // Or configure per provider services.AddSimpleMessageBusAzureStoragePublisher(options => { options.SerializerOptions = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; }); ``` ## Configuration Best Practices ### 1. Use Configuration Sections Organize configuration in `appsettings.json`: ```json theme={"dark"} { "SimpleMessageBus": { "Azure": { "ConnectionString": "DefaultEndpointsProtocol=https;...", "DefaultQueueName": "messages", "MaxConcurrentMessages": 32, "PollingInterval": "00:00:05" }, "Amazon": { "Region": "us-east-1", "DefaultQueueName": "messages", "UseFifoQueues": false, "WaitTimeSeconds": 20 } } } ``` ```csharp theme={"dark"} services.AddSimpleMessageBusAzureStoragePublisher(options => { builder.Configuration.GetSection("SimpleMessageBus:Azure").Bind(options); }); ``` ### 2. Environment-Specific Settings Use different configuration files per environment: ```json theme={"dark"} // appsettings.Development.json { "SimpleMessageBus": { "Provider": "FileSystem", "FileSystem": { "RootPath": "./dev-messages", "PollingInterval": "00:00:01" } } } // appsettings.Production.json { "SimpleMessageBus": { "Provider": "AmazonSQS", "Amazon": { "Region": "us-east-1", "UseInstanceProfile": true, "WaitTimeSeconds": 20 } } } ``` ### 3. Secure Configuration Store sensitive values in Azure Key Vault or AWS Secrets Manager: ```csharp theme={"dark"} // Azure Key Vault builder.Configuration.AddAzureKeyVault( vaultUri: "https://myvault.vault.azure.net/", credential: new DefaultAzureCredential()); // AWS Secrets Manager builder.Configuration.AddSecretsManager(region: RegionEndpoint.USEast1); // Use in configuration services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = builder.Configuration["SimpleMessageBus:ConnectionString"]; }); ``` ### 4. Configuration Validation Validate configuration at startup: ```csharp theme={"dark"} services.Configure( builder.Configuration.GetSection("SimpleMessageBus:Azure")); services.AddOptions() .Configure(builder.Configuration.GetSection("SimpleMessageBus:Azure")) .ValidateDataAnnotations() .ValidateOnStart(); public class AzureStorageOptions { [Required] public string ConnectionString { get; set; } [Required] [RegularExpression(@"^[a-z0-9-]+$")] public string DefaultQueueName { get; set; } [Range(1, 32)] public int MaxConcurrentMessages { get; set; } = 16; } ``` ## Monitoring and Observability Configuration ### Logging Configure structured logging: ```csharp theme={"dark"} builder.Services.AddLogging(logging => { logging.ClearProviders(); logging.AddConsole(); logging.AddApplicationInsights(); // Filter SimpleMessageBus logs logging.AddFilter("SimpleMessageBus", LogLevel.Information); }); ``` ### Metrics Configure metrics collection: ```csharp theme={"dark"} builder.Services.AddMetrics(); // Custom metrics services.AddSingleton(provider => { var factory = provider.GetRequiredService(); return factory.Create("SimpleMessageBus.Application"); }); ``` ### Health Checks Add health checks for message bus components: ```csharp theme={"dark"} services.AddHealthChecks() .AddCheck("messagebus") .AddAzureQueueStorage(connectionString, "messages") .AddSqs(options => { ... }); ``` ## Testing Configuration ### Integration Tests Configure for integration testing: ```csharp theme={"dark"} public class TestStartup { public void ConfigureServices(IServiceCollection services) { // Use in-memory provider for tests services.AddSimpleMessageBusInMemoryProvider(); // Or use test containers services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = "UseDevelopmentStorage=true"; }); } } ``` ### Unit Tests Mock configuration for unit tests: ```csharp theme={"dark"} [Test] public void Configure_WithValidOptions_RegistersServices() { var services = new ServiceCollection(); var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new Dictionary { ["ConnectionString"] = "UseDevelopmentStorage=true", ["DefaultQueueName"] = "test-queue" }) .Build(); services.AddSimpleMessageBusAzureStoragePublisher(options => { configuration.Bind(options); }); var provider = services.BuildServiceProvider(); var publisher = provider.GetService(); Assert.That(publisher, Is.Not.Null); } ``` ## Troubleshooting Configuration Issues **Problem**: Authentication failures or connection errors **Solutions**: * Verify connection string format * Check account credentials * Ensure network connectivity * Validate queue/storage account exists ```csharp theme={"dark"} // Test connection at startup services.AddHealthChecks() .AddAzureQueueStorage(connectionString); ``` **Problem**: Handlers not receiving messages **Solutions**: * Verify handler implements `IMessageHandler` * Check `GetHandledMessageTypes()` returns correct types * Ensure handler is registered in DI container * Verify message type matches exactly ```csharp theme={"dark"} // Debug handler registration var handlers = serviceProvider.GetServices(); foreach (var handler in handlers) { var types = handler.GetHandledMessageTypes(); Console.WriteLine($"Handler {handler.GetType().Name} handles: {string.Join(", ", types.Select(t => t.Name))}"); } ``` **Problem**: Slow message processing **Solutions**: * Increase `MaxConcurrentMessages` * Reduce `PollingInterval` * Optimize handler performance * Consider batch processing ```csharp theme={"dark"} // Performance-optimized configuration options.MaxConcurrentMessages = Environment.ProcessorCount * 4; options.PollingInterval = TimeSpan.FromSeconds(1); options.BatchSize = 32; ``` ## Next Steps Learn how to test your configuration Implement robust error handling Optimize for production workloads Deep dive into specific providers # Core Concepts Source: https://easyaf.dev/simplemessagebus/guides/overview Understanding the fundamental concepts of SimpleMessageBus SimpleMessageBus is built around a few core concepts that work together to provide a simple yet powerful messaging system. Understanding these concepts will help you effectively use the library in your applications. ## Architecture Overview SimpleMessageBus Architecture SimpleMessageBus follows a publisher-subscriber pattern with the following key components: * **Messages**: Data structures that carry information between components * **Publishers**: Components that send messages to a transport mechanism * **Handlers**: Components that process messages when they are received * **Dispatchers**: Components that coordinate message delivery to handlers * **Providers**: Transport-specific implementations (Azure, AWS, File System, IndexedDB) ## Messages Messages are the fundamental units of communication in SimpleMessageBus. They represent events, commands, or notifications that need to be processed. All messages must implement the `IMessage` interface: ```csharp theme={"dark"} public interface IMessage { // Marker interface - no members required } ``` Create a message class with the data you need to communicate: ```csharp theme={"dark"} public class OrderProcessedMessage : IMessage { public string OrderId { get; set; } public decimal TotalAmount { get; set; } public DateTime ProcessedAt { get; set; } public string CustomerId { get; set; } } ``` Internally, SimpleMessageBus wraps your messages in a `MessageEnvelope` that adds metadata: ```csharp theme={"dark"} public class MessageEnvelope { public string MessageId { get; set; } public string MessageType { get; set; } public string CorrelationId { get; set; } public DateTime Timestamp { get; set; } public string Content { get; set; } // Serialized message public Dictionary Headers { get; set; } } ``` ## Publishers Publishers are responsible for sending messages to the underlying transport mechanism. They serialize messages and handle transport-specific details. ### IMessagePublisher Interface ```csharp theme={"dark"} public interface IMessagePublisher { Task PublishAsync(T message) where T : IMessage; Task PublishAsync(T message, CancellationToken cancellationToken) where T : IMessage; } ``` ### Usage Example ```csharp theme={"dark"} public class OrderService { private readonly IMessagePublisher _publisher; public OrderService(IMessagePublisher publisher) { _publisher = publisher; } public async Task ProcessOrder(Order order) { // Process the order await SaveOrderToDatabase(order); // Publish message await _publisher.PublishAsync(new OrderProcessedMessage { OrderId = order.Id, TotalAmount = order.Total, ProcessedAt = DateTime.UtcNow, CustomerId = order.CustomerId }); } } ``` ## Handlers Handlers contain the business logic for processing messages. They implement the `IMessageHandler` interface. ### IMessageHandler Interface ```csharp theme={"dark"} public interface IMessageHandler where T : IMessage { Task HandleAsync(T message); } ``` ### Handler Implementation ```csharp theme={"dark"} public class OrderProcessedHandler : IMessageHandler { private readonly IEmailService _emailService; private readonly ILogger _logger; public OrderProcessedHandler(IEmailService emailService, ILogger logger) { _emailService = emailService; _logger = logger; } public async Task HandleAsync(OrderProcessedMessage message) { _logger.LogInformation("Processing order {OrderId} for customer {CustomerId}", message.OrderId, message.CustomerId); try { // Send confirmation email await _emailService.SendOrderConfirmationAsync( message.CustomerId, message.OrderId, message.TotalAmount); _logger.LogInformation("Order confirmation sent for {OrderId}", message.OrderId); } catch (Exception ex) { _logger.LogError(ex, "Failed to send order confirmation for {OrderId}", message.OrderId); throw; // Re-throw to trigger retry mechanisms } } } ``` ## Dispatchers Dispatchers coordinate the delivery of messages from the transport mechanism to the appropriate handlers. They handle deserialization, routing, and error handling. ### IMessageDispatcher Interface ```csharp theme={"dark"} public interface IMessageDispatcher { Task DispatchAsync(MessageEnvelope envelope); Task DispatchAsync(MessageEnvelope envelope, CancellationToken cancellationToken); } ``` ### Dispatcher Types Processes messages concurrently for maximum throughput: ```csharp theme={"dark"} services.AddSimpleMessageBusParallelDispatcher(options => { options.MaxConcurrency = Environment.ProcessorCount * 2; options.BatchSize = 10; }); ``` **Best for**: High-throughput scenarios where message order doesn't matter. Processes messages sequentially to maintain order: ```csharp theme={"dark"} services.AddSimpleMessageBusOrderedDispatcher(); ``` **Best for**: Scenarios where processing order must be maintained. ## Queue Processors Queue processors are provider-specific components that poll the underlying transport for new messages and forward them to dispatchers. ### IQueueProcessor Interface ```csharp theme={"dark"} public interface IQueueProcessor { Task StartAsync(CancellationToken cancellationToken); Task StopAsync(CancellationToken cancellationToken); } ``` ### Provider-Specific Processors Polls Azure Storage Queues for new messages using configurable polling intervals. **Features**: * Configurable polling intervals * Automatic message visibility timeout handling * Batch message retrieval Long-polls Amazon SQS queues for efficient message retrieval. **Features**: * Long polling support (up to 20 seconds) * FIFO queue support * Dead letter queue integration Watches file system directories for new message files. **Features**: * FileSystemWatcher integration * Automatic file cleanup * Error file handling Monitors IndexedDB for new messages in Blazor WebAssembly applications. **Features**: * Browser-native storage * Offline-first support * Client-side message processing ## Message Flow Here's how messages flow through the system: ```mermaid theme={"dark"} graph LR A[Application] --> B[Publisher] B --> C[Transport
Queue/File/DB] C --> D[Queue Processor] D --> E[Dispatcher] E --> F[Handler] F --> G[Business Logic] ``` 1. **Application** creates and publishes a message 2. **Publisher** serializes and sends the message to the transport 3. **Transport** stores the message (queue, file, database) 4. **Queue Processor** retrieves the message from transport 5. **Dispatcher** deserializes and routes the message 6. **Handler** processes the message with business logic ## Error Handling SimpleMessageBus provides several mechanisms for handling errors: Most providers support automatic retry with configurable policies: ```csharp theme={"dark"} services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.MaxRetryAttempts = 3; options.RetryDelay = TimeSpan.FromSeconds(30); options.BackoffMultiplier = 2.0; }); ``` Configure exponential backoff to handle transient failures gracefully. Failed messages can be automatically moved to dead letter queues: ```csharp theme={"dark"} services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.DeadLetterQueueName = "failed-messages"; options.MaxDeliveryCount = 5; }); ``` Isolate poison messages for later analysis and manual intervention. Handlers should implement proper exception handling: ```csharp theme={"dark"} public async Task HandleAsync(MyMessage message) { try { await ProcessMessage(message); } catch (BusinessException ex) { // Log and ignore - don't retry business rule violations _logger.LogWarning(ex, "Business rule violation for message {MessageId}", message.Id); } catch (TransientException ex) { // Log and re-throw - allow retry for transient failures _logger.LogError(ex, "Transient error processing message {MessageId}", message.Id); throw; } } ``` Distinguish between retriable transient failures and permanent business logic errors. ## Next Steps Now that you understand the core concepts, dive deeper into specific areas: Learn about message design and best practices Understand publishing patterns and configuration Master message processing and error handling Configure message routing and concurrency # Testing Guide Source: https://easyaf.dev/simplemessagebus/guides/testing Complete guide to testing SimpleMessageBus applications This guide covers all aspects of testing applications that use SimpleMessageBus, from unit testing message handlers to integration testing with real queue providers. ## Overview Testing messaging applications requires different strategies than traditional request-response applications. This guide covers: Testing message handlers in isolation Testing with real queue providers Testing complete message flows Using SimpleMessageBus.Breakdance for testing ## Unit Testing Message Handlers ### Basic Handler Testing Test message handlers using mocks and dependency injection: ```csharp theme={"dark"} [TestFixture] public class OrderCreatedHandlerTests { private Mock _mockOrderService; private Mock> _mockLogger; private OrderCreatedHandler _handler; [SetUp] public void SetUp() { _mockOrderService = new Mock(); _mockLogger = new Mock>(); _handler = new OrderCreatedHandler(_mockOrderService.Object, _mockLogger.Object); } [Test] public async Task OnNextAsync_ValidOrder_ProcessesSuccessfully() { // Arrange var message = new OrderCreatedMessage { Id = Guid.NewGuid(), OrderNumber = "ORD-001", TotalAmount = 99.99m, CustomerId = "CUST-123" }; var envelope = new MessageEnvelope(message); // Act await _handler.OnNextAsync(envelope); // Assert _mockOrderService.Verify(x => x.ProcessNewOrderAsync( It.Is(m => m.OrderNumber == "ORD-001" && m.TotalAmount == 99.99m)), Times.Once); } [Test] public async Task OnNextAsync_ServiceThrowsException_PropagatesException() { // Arrange var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; var envelope = new MessageEnvelope(message); _mockOrderService .Setup(x => x.ProcessNewOrderAsync(It.IsAny())) .ThrowsAsync(new InvalidOperationException("Service error")); // Act & Assert var ex = await Assert.ThrowsAsync( () => _handler.OnNextAsync(envelope)); Assert.That(ex.Message, Is.EqualTo("Service error")); } [Test] public async Task OnErrorAsync_HandlesErrorGracefully() { // Arrange var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; var exception = new InvalidOperationException("Test error"); // Act await _handler.OnErrorAsync(message, exception); // Assert _mockOrderService.Verify(x => x.HandleOrderProcessingErrorAsync( message, exception), Times.Once); } [Test] public void GetHandledMessageTypes_ReturnsCorrectTypes() { // Act var types = _handler.GetHandledMessageTypes().ToList(); // Assert Assert.That(types, Has.Count.EqualTo(1)); Assert.That(types[0], Is.EqualTo(typeof(OrderCreatedMessage))); } } ``` ### Testing Multi-Message Handlers Test handlers that process multiple message types: ```csharp theme={"dark"} [TestFixture] public class OrderEventHandlerTests { private Mock _mockOrderService; private OrderEventHandler _handler; [SetUp] public void SetUp() { _mockOrderService = new Mock(); _handler = new OrderEventHandler(_mockOrderService.Object); } [Test] public async Task OnNextAsync_OrderCreatedMessage_CallsCreateOrder() { // Arrange var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; var envelope = new MessageEnvelope(message); // Act await _handler.OnNextAsync(envelope); // Assert _mockOrderService.Verify(x => x.CreateOrderAsync(message), Times.Once); _mockOrderService.Verify(x => x.CancelOrderAsync(It.IsAny()), Times.Never); } [Test] public async Task OnNextAsync_OrderCancelledMessage_CallsCancelOrder() { // Arrange var message = new OrderCancelledMessage { OrderNumber = "ORD-001" }; var envelope = new MessageEnvelope(message); // Act await _handler.OnNextAsync(envelope); // Assert _mockOrderService.Verify(x => x.CancelOrderAsync(message), Times.Once); _mockOrderService.Verify(x => x.CreateOrderAsync(It.IsAny()), Times.Never); } [Test] public async Task OnNextAsync_UnsupportedMessage_ThrowsNotSupportedException() { // Arrange var message = new UnsupportedMessage(); var envelope = new MessageEnvelope(message); // Act & Assert var ex = await Assert.ThrowsAsync( () => _handler.OnNextAsync(envelope)); Assert.That(ex.Message, Does.Contain("not supported")); } [Test] public void GetHandledMessageTypes_ReturnsAllSupportedTypes() { // Act var types = _handler.GetHandledMessageTypes().ToList(); // Assert Assert.That(types, Has.Count.EqualTo(3)); Assert.That(types, Does.Contain(typeof(OrderCreatedMessage))); Assert.That(types, Does.Contain(typeof(OrderCancelledMessage))); Assert.That(types, Does.Contain(typeof(OrderShippedMessage))); } } ``` ### Testing Message Publishing Test services that publish messages: ```csharp theme={"dark"} [TestFixture] public class OrderServiceTests { private Mock _mockPublisher; private Mock _mockRepository; private OrderService _service; [SetUp] public void SetUp() { _mockPublisher = new Mock(); _mockRepository = new Mock(); _service = new OrderService(_mockPublisher.Object, _mockRepository.Object); } [Test] public async Task CreateOrderAsync_ValidOrder_PublishesMessage() { // Arrange var request = new CreateOrderRequest { CustomerI1d = "CUST-123", Items = new[] { new OrderItem { ProductId = "PROD-1", Quantity = 2 } } }; var savedOrder = new Order { Id = Guid.NewGuid(), OrderNumber = "ORD-001", CustomerId = request.CustomerId }; _mockRepository .Setup(x => x.SaveOrderAsync(It.IsAny())) .ReturnsAsync(savedOrder); // Act var result = await _service.CreateOrderAsync(request); // Assert Assert.That(result.OrderNumber, Is.EqualTo("ORD-001")); _mockPublisher.Verify(x => x.PublishAsync( It.Is(m => m.OrderNumber == "ORD-001" && m.CustomerId == "CUST-123")), Times.Once); } [Test] public async Task CreateOrderAsync_RepositoryFails_DoesNotPublishMessage() { // Arrange var request = new CreateOrderRequest { CustomerId = "CUST-123" }; _mockRepository .Setup(x => x.SaveOrderAsync(It.IsAny())) .ThrowsAsync(new InvalidOperationException("Database error")); // Act & Assert await Assert.ThrowsAsync( () => _service.CreateOrderAsync(request)); _mockPublisher.Verify(x => x.PublishAsync(It.IsAny()), Times.Never); } } ``` ## Integration Testing Use test containers for integration testing with real infrastructure: Start a containerized instance of your message queue: ```csharp theme={"dark"} [TestFixture] public class OrderProcessingIntegrationTests { private AzuriteContainer _azuriteContainer; private IServiceProvider _serviceProvider; [OneTimeSetUp] public async Task OneTimeSetUp() { // Start Azurite container for Azure Storage emulation _azuriteContainer = new AzuriteBuilder() .WithImage("mcr.microsoft.com/azure-storage/azurite:latest") .Build(); await _azuriteContainer.StartAsync(); } [OneTimeTearDown] public async Task OneTimeTearDown() { await _azuriteContainer.DisposeAsync(); } } ``` Configure SimpleMessageBus to use the test container: ```csharp theme={"dark"} [SetUp] public void SetUp() { var services = new ServiceCollection(); // Configure SimpleMessageBus with test container services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = _azuriteContainer.GetConnectionString(); options.DefaultQueueName = "test-orders"; }); services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = _azuriteContainer.GetConnectionString(); options.DefaultQueueName = "test-orders"; options.PollingInterval = TimeSpan.FromMilliseconds(100); }); // Register test services services.AddScoped(); services.AddSingleton(); services.AddLogging(); _serviceProvider = services.BuildServiceProvider(); } ``` Test the complete message flow: ```csharp theme={"dark"} [Test] public async Task PublishAndProcess_OrderCreatedMessage_ProcessedSuccessfully() { // Arrange var publisher = _serviceProvider.GetRequiredService(); var orderService = _serviceProvider.GetRequiredService(); var message = new OrderCreatedMessage { OrderNumber = "ORD-001", CustomerId = "CUST-123", TotalAmount = 99.99m }; // Act await publisher.PublishAsync(message); // Wait for message processing await WaitForMessageProcessingAsync(orderService, message.Id, TimeSpan.FromSeconds(5)); // Assert Assert.That(orderService.ProcessedOrders, Has.Count.EqualTo(1)); var processedOrder = orderService.ProcessedOrders.First(); Assert.That(processedOrder.OrderNumber, Is.EqualTo("ORD-001")); } ``` For faster tests, use in-memory implementations: ```csharp theme={"dark"} [TestFixture] public class InMemoryMessageBusTests { private IServiceProvider _serviceProvider; private TestMessageBus _messageBus; [SetUp] public void SetUp() { _messageBus = new TestMessageBus(); var services = new ServiceCollection(); services.AddSingleton(_messageBus); services.AddSingleton(_messageBus); services.AddScoped(); services.AddLogging(); _serviceProvider = services.BuildServiceProvider(); } [Test] public async Task PublishAndDispatch_OrderMessage_ProcessedByHandler() { // Arrange var publisher = _serviceProvider.GetRequiredService(); var handlers = _serviceProvider.GetServices(); var message = new OrderCreatedMessage { OrderNumber = "ORD-001", CustomerId = "CUST-123" }; // Act await publisher.PublishAsync(message); // Process messages await _messageBus.ProcessAllMessagesAsync(handlers); // Assert Assert.That(_messageBus.ProcessedMessages, Has.Count.EqualTo(1)); var processedMessage = _messageBus.ProcessedMessages.First(); Assert.That(processedMessage.GetType(), Is.EqualTo(typeof(OrderCreatedMessage))); } } public class TestMessageBus : IMessagePublisher, IMessageDispatcher { private readonly Queue _messages = new(); public List ProcessedMessages { get; } = new(); public Task PublishAsync(IMessage message, bool isSystemGenerated = false) { var envelope = new MessageEnvelope(message); _messages.Enqueue(envelope); return Task.CompletedTask; } public async Task Dispatch(MessageEnvelope messageEnvelope) { ProcessedMessages.Add(messageEnvelope.Message); // Simulate processing by handlers await Task.Delay(10); } public async Task ProcessAllMessagesAsync(IEnumerable handlers) { while (_messages.Count > 0) { var envelope = _messages.Dequeue(); foreach (var handler in handlers) { var handledTypes = handler.GetHandledMessageTypes(); if (handledTypes.Contains(envelope.Message.GetType())) { await handler.OnNextAsync(envelope); } } await Dispatch(envelope); } } } ``` **Benefits**: Faster execution, no external dependencies, easier debugging. ## Using SimpleMessageBus.Breakdance SimpleMessageBus.Breakdance provides testing utilities for easier testing: Add the Breakdance testing package to your test project: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Breakdance --version 1.0.0-preview ``` Use the testable publisher for unit testing: ```csharp theme={"dark"} [TestFixture] public class OrderServiceBreakdanceTests { private TestableMessagePublisher _testPublisher; private OrderService _orderService; [SetUp] public void SetUp() { _testPublisher = new TestableMessagePublisher(); _orderService = new OrderService(_testPublisher); } [Test] public async Task CreateOrder_PublishesCorrectMessage() { // Arrange var request = new CreateOrderRequest { CustomerId = "CUST-123", Items = new[] { new OrderItem { ProductId = "PROD-1", Quantity = 2 } } }; // Act await _orderService.CreateOrderAsync(request); // Assert _testPublisher.ShouldHavePublished(message => message.CustomerId == "CUST-123" && message.Items.Length == 1); } [Test] public async Task CreateMultipleOrders_PublishesMultipleMessages() { // Arrange & Act await _orderService.CreateOrderAsync(new CreateOrderRequest { CustomerId = "CUST-1" }); await _orderService.CreateOrderAsync(new CreateOrderRequest { CustomerId = "CUST-2" }); // Assert _testPublisher.ShouldHavePublished(2); _testPublisher.ShouldHavePublished(m => m.CustomerId == "CUST-1"); _testPublisher.ShouldHavePublished(m => m.CustomerId == "CUST-2"); } [Test] public void NoOrdersCreated_NoMessagesPublished() { // Assert _testPublisher.ShouldNotHavePublished(); _testPublisher.ShouldNotHavePublishedAnyMessages(); } } ``` The TestableMessagePublisher provides various assertion methods: ```csharp theme={"dark"} // Verify specific message was published _testPublisher.ShouldHavePublished(); // Verify message with condition _testPublisher.ShouldHavePublished(m => m.OrderNumber == "ORD-001"); // Verify number of messages _testPublisher.ShouldHavePublished(3); // Verify no messages published _testPublisher.ShouldNotHavePublished(); _testPublisher.ShouldNotHavePublishedAnyMessages(); // Get published messages for custom assertions var messages = _testPublisher.GetPublishedMessages(); Assert.That(messages, Has.Count.EqualTo(2)); // Clear published messages _testPublisher.Clear(); ``` ## End-to-End Testing ### Complete Workflow Testing Test entire message workflows from start to finish: ```csharp theme={"dark"} [TestFixture] public class OrderWorkflowE2ETests { private WebApplicationFactory _factory; private IServiceScope _scope; [SetUp] public void SetUp() { _factory = new WebApplicationFactory() .WithWebHostBuilder(builder => { builder.ConfigureServices(services => { // Use in-memory database services.AddDbContext(options => options.UseInMemoryDatabase("test-db")); // Use test message bus services.AddSingleton(); services.AddSingleton(p => p.GetService()); services.AddSingleton(p => p.GetService()); }); }); _scope = _factory.Services.CreateScope(); } [Test] public async Task CompleteOrderWorkflow_ProcessesAllSteps() { // Arrange var client = _factory.CreateClient(); var messageBus = _scope.ServiceProvider.GetRequiredService(); var handlers = _scope.ServiceProvider.GetServices(); var createRequest = new { CustomerId = "CUST-123", Items = new[] { new { ProductId = "PROD-1", Quantity = 2, Price = 49.99 } } }; // Act - Create Order var response = await client.PostAsJsonAsync("/api/orders", createRequest); response.EnsureSuccessStatusCode(); var order = await response.Content.ReadFromJsonAsync(); // Process messages await messageBus.ProcessAllMessagesAsync(handlers); // Assert - Verify complete workflow var publishedMessages = messageBus.GetAllPublishedMessages(); // Should have published OrderCreated, InventoryReserved, PaymentProcessed, OrderShipped Assert.That(publishedMessages.OfType(), Has.Count.EqualTo(1)); Assert.That(publishedMessages.OfType(), Has.Count.EqualTo(1)); Assert.That(publishedMessages.OfType(), Has.Count.EqualTo(1)); Assert.That(publishedMessages.OfType(), Has.Count.EqualTo(1)); // Verify final order state var finalOrderResponse = await client.GetAsync($"/api/orders/{order.Id}"); var finalOrder = await finalOrderResponse.Content.ReadFromJsonAsync(); Assert.That(finalOrder.Status, Is.EqualTo("Shipped")); } [TearDown] public void TearDown() { _scope?.Dispose(); _factory?.Dispose(); } } ``` ### Performance Testing Test message processing under load: ```csharp theme={"dark"} [TestFixture] public class MessageProcessingPerformanceTests { [Test] public async Task ProcessLargeNumberOfMessages_CompletesWithinTimeout() { // Arrange const int messageCount = 1000; var publisher = new TestableMessagePublisher(); var handler = new OrderCreatedHandler(Mock.Of(), Mock.Of>()); var messages = Enumerable.Range(1, messageCount) .Select(i => new OrderCreatedMessage { OrderNumber = $"ORD-{i:D4}", CustomerId = $"CUST-{i % 100}", TotalAmount = i * 10m }) .ToList(); // Act var stopwatch = Stopwatch.StartNew(); var publishTasks = messages.Select(m => publisher.PublishAsync(m)); await Task.WhenAll(publishTasks); var processTasks = messages.Select(async m => { var envelope = new MessageEnvelope(m); await handler.OnNextAsync(envelope); }); await Task.WhenAll(processTasks); stopwatch.Stop(); // Assert Assert.That(stopwatch.ElapsedMilliseconds, Is.LessThan(5000), $"Processing {messageCount} messages took {stopwatch.ElapsedMilliseconds}ms"); Assert.That(publisher.GetPublishedMessages(), Has.Count.EqualTo(messageCount)); } } ``` ## Test Utilities and Helpers ### Custom Test Builders Create builders for complex test data: ```csharp theme={"dark"} public class OrderMessageBuilder { private readonly OrderCreatedMessage _message; public OrderMessageBuilder() { _message = new OrderCreatedMessage { Id = Guid.NewGuid(), OrderNumber = "ORD-001", CustomerId = "CUST-123", TotalAmount = 99.99m, CreatedAt = DateTime.UtcNow }; } public OrderMessageBuilder WithOrderNumber(string orderNumber) { _message.OrderNumber = orderNumber; return this; } public OrderMessageBuilder WithCustomer(string customerId) { _message.CustomerId = customerId; return this; } public OrderMessageBuilder WithAmount(decimal amount) { _message.TotalAmount = amount; return this; } public OrderMessageBuilder WithMetadata(string key, object value) { if (_message is IMetadataAware metadataMessage) { metadataMessage.Metadata[key] = value; } return this; } public OrderCreatedMessage Build() => _message; public static implicit operator OrderCreatedMessage(OrderMessageBuilder builder) => builder.Build(); } // Usage in tests [Test] public async Task ProcessOrder_WithHighValue_SendsAlert() { // Arrange OrderCreatedMessage message = new OrderMessageBuilder() .WithOrderNumber("ORD-999") .WithAmount(10000m) .WithMetadata("Priority", "High"); // Act & Assert await _handler.OnNextAsync(new MessageEnvelope(message)); _mockAlertService.Verify(x => x.SendHighValueOrderAlertAsync( It.Is(m => m.TotalAmount == 10000m)), Times.Once); } ``` ### Test Fixtures Create reusable test fixtures: ```csharp theme={"dark"} public class MessageHandlerTestFixture { public IServiceProvider ServiceProvider { get; private set; } public TestableMessagePublisher TestPublisher { get; private set; } [OneTimeSetUp] public void OneTimeSetUp() { var services = new ServiceCollection(); TestPublisher = new TestableMessagePublisher(); services.AddSingleton(TestPublisher); // Add common test services services.AddLogging(); services.AddSingleton(Mock.Of()); services.AddSingleton(Mock.Of()); services.AddSingleton(Mock.Of()); ServiceProvider = services.BuildServiceProvider(); } [SetUp] public void SetUp() { TestPublisher.Clear(); } [OneTimeTearDown] public void OneTimeTearDown() { ServiceProvider?.Dispose(); } } [TestFixture] public class OrderHandlerTests : MessageHandlerTestFixture { private OrderCreatedHandler _handler; [SetUp] public void SetUp() { base.SetUp(); _handler = new OrderCreatedHandler( ServiceProvider.GetRequiredService(), ServiceProvider.GetRequiredService>()); } [Test] public async Task ProcessOrder_CallsOrderService() { // Test implementation using inherited fixtures var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; await _handler.OnNextAsync(new MessageEnvelope(message)); // Assertions... } } ``` ## Best Practices ### 1. Test Isolation Ensure tests don't interfere with each other: ```csharp theme={"dark"} [Test] public async Task Test1_DoesNotAffectTest2() { // Use fresh instances for each test var publisher = new TestableMessagePublisher(); var handler = CreateHandler(); // Test logic... // Verify state is isolated publisher.ShouldNotHavePublishedAnyMessages(); } ``` ### 2. Deterministic Testing Make tests deterministic by controlling time and random values: ```csharp theme={"dark"} public class TimeControlledOrderHandler : IMessageHandler { private readonly IDateTimeProvider _dateTimeProvider; public TimeControlledOrderHandler(IDateTimeProvider dateTimeProvider) { _dateTimeProvider = dateTimeProvider; } public async Task OnNextAsync(MessageEnvelope envelope) { var message = envelope.GetMessage(); message.ProcessedAt = _dateTimeProvider.UtcNow; // Process message... } } [Test] public async Task ProcessOrder_SetsCorrectProcessedTime() { // Arrange var fixedTime = new DateTime(2024, 1, 1, 12, 0, 0, DateTimeKind.Utc); var mockDateTimeProvider = new Mock(); mockDateTimeProvider.Setup(x => x.UtcNow).Returns(fixedTime); var handler = new TimeControlledOrderHandler(mockDateTimeProvider.Object); var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; // Act await handler.OnNextAsync(new MessageEnvelope(message)); // Assert Assert.That(message.ProcessedAt, Is.EqualTo(fixedTime)); } ``` ### 3. Test Error Scenarios Always test error conditions: ```csharp theme={"dark"} [Test] public async Task OnNextAsync_DatabaseUnavailable_HandlesGracefully() { // Arrange var mockOrderService = new Mock(); mockOrderService .Setup(x => x.ProcessNewOrderAsync(It.IsAny())) .ThrowsAsync(new SqlException("Database connection failed")); var handler = new OrderCreatedHandler(mockOrderService.Object, Mock.Of>()); var message = new OrderCreatedMessage { OrderNumber = "ORD-001" }; // Act & Assert var ex = await Assert.ThrowsAsync( () => handler.OnNextAsync(new MessageEnvelope(message))); Assert.That(ex.Message, Does.Contain("Database connection failed")); } ``` ### 4. Verify Side Effects Test all side effects of message processing: ```csharp theme={"dark"} [Test] public async Task ProcessOrder_SendsNotificationAndLogsEvent() { // Arrange var mockNotificationService = new Mock(); var mockLogger = new Mock>(); var handler = new OrderCreatedHandler(mockNotificationService.Object, mockLogger.Object); var message = new OrderCreatedMessage { OrderNumber = "ORD-001", CustomerId = "CUST-123" }; // Act await handler.OnNextAsync(new MessageEnvelope(message)); // Assert - Verify all side effects mockNotificationService.Verify(x => x.SendOrderConfirmationAsync( "CUST-123", "ORD-001"), Times.Once); mockLogger.Verify( x => x.Log( LogLevel.Information, It.IsAny(), It.Is((v, t) => v.ToString().Contains("ORD-001")), It.IsAny(), It.IsAny>()), Times.AtLeastOnce); } ``` ## Next Steps Learn how to handle and test error scenarios Test and optimize performance Test different configurations Explore the complete API # Introducing SimpleMessageBus Source: https://easyaf.dev/simplemessagebus/index A simple, lightweight message bus for .NET applications SimpleMessageBus Hero Light SimpleMessageBus Hero Dark ## What is SimpleMessageBus? SimpleMessageBus is a lightweight, cross-platform message bus library for .NET applications. It provides a simple abstraction for publishing and consuming messages across different transport mechanisms including Azure Storage Queues, Amazon SQS, file systems, and browser IndexedDB. Support for Azure, AWS, file system, and IndexedDB providers Clean, intuitive APIs that are easy to learn and use Works with .NET 8, 9, and 10 across multiple platforms Easy to extend with custom providers and message handlers ## Key Features * **Multiple Transport Providers**: Azure Storage Queues, Amazon SQS, File System, IndexedDB * **Dependency Injection**: Built-in support for Microsoft.Extensions.DependencyInjection * **Azure Functions Integration**: First-class support for Azure Functions and WebJobs * **Blazor WebAssembly Support**: IndexedDB provider for client-side messaging * **Serialization**: JSON serialization with extensible message contracts * **Error Handling**: Robust error handling and retry mechanisms * **Testing Support**: Breakdance testing utilities included ## Use Cases Enable loose coupling between microservices using message-based communication patterns. Queue work items for background processing in web applications. Implement event-driven patterns with domain events and message handlers. Client-side message queuing for offline scenarios and local data processing. ## Getting Started Ready to get started? Choose your path: Get up and running in 5 minutes Detailed installation instructions ## Community SimpleMessageBus is an open-source project maintained by CloudNimble. We welcome contributions, feedback, and community involvement. * **GitHub**: [CloudNimble/SimpleMessageBus](https://github.com/CloudNimble/SimpleMessageBus) * **Issues**: Report bugs and request features * **Discussions**: Join community discussions and get help ## License SimpleMessageBus is released under the MIT License. See the [LICENSE](https://github.com/CloudNimble/SimpleMessageBus/blob/main/LICENSE) file for details. # Installation Source: https://easyaf.dev/simplemessagebus/installation Detailed installation instructions for SimpleMessageBus ## Package Selection SimpleMessageBus is distributed as multiple NuGet packages based on the provider you want to use. Choose the packages that match your infrastructure and requirements. ### Core Packages Core interfaces and base classes. Required by all other packages. Hosting extensions for background services and message processing. ### Publishing Packages **File System Publisher** Basic file system-based message publishing. Good for development and simple scenarios. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish ``` **Azure Storage Queue Publisher** Publishes messages to Azure Storage Queues. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.Azure ``` **Dependencies:** * Azure.Storage.Queues * Microsoft.Extensions.DependencyInjection **Amazon SQS Publisher** Publishes messages to Amazon SQS queues. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.Amazon ``` **Dependencies:** * AWSSDK.SQS * Microsoft.Extensions.DependencyInjection **IndexedDB Publisher (Blazor WebAssembly)** Client-side message publishing using browser IndexedDB. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.IndexedDb ``` **Requirements:** * Blazor WebAssembly project * .NET 8+ target framework ### Dispatching Packages **Core Dispatcher** Base dispatcher functionality and interfaces. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Dispatch ``` **Azure Storage Queue Dispatcher** Processes messages from Azure Storage Queues. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Dispatch.Azure ``` **Amazon SQS Dispatcher** Processes messages from Amazon SQS queues. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Dispatch.Amazon ``` **File System Dispatcher** Processes messages from file system storage. Includes Azure Functions trigger support. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Dispatch.FileSystem ``` **IndexedDB Dispatcher (Blazor WebAssembly)** Client-side message processing using browser IndexedDB. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Dispatch.IndexedDb ``` ### Testing Package Testing utilities and mocks for unit testing message handlers. ```bash theme={"dark"} dotnet add package SimpleMessageBus.Breakdance --version 1.0.0-preview ``` ## Installation by Scenario ### Web Application with Azure Storage For ASP.NET Core applications using Azure Storage Queues: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.Azure dotnet add package SimpleMessageBus.Dispatch.Azure dotnet add package SimpleMessageBus.Hosting ``` ### Console Application with Amazon SQS For console applications using Amazon SQS: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.Amazon dotnet add package SimpleMessageBus.Dispatch.Amazon dotnet add package SimpleMessageBus.Hosting dotnet add package Microsoft.Extensions.Hosting ``` ### Azure Functions For Azure Functions with file system triggers: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish dotnet add package SimpleMessageBus.Dispatch.FileSystem dotnet add package Microsoft.Azure.WebJobs.Extensions ``` ### Blazor WebAssembly For client-side Blazor applications: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.IndexedDb dotnet add package SimpleMessageBus.Dispatch.IndexedDb ``` ### Development and Testing For development and testing scenarios: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish dotnet add package SimpleMessageBus.Dispatch.FileSystem dotnet add package SimpleMessageBus.Breakdance ``` ## Framework Requirements SimpleMessageBus requires .NET 8.0 or later. It supports .NET 8, 9, and 10. ### Supported Platforms * **Windows**: Full support for all providers * **Linux**: Full support for all providers * **macOS**: Full support for all providers * **Browser (Blazor WebAssembly)**: IndexedDB provider only ### Target Frameworks All packages multi-target the following frameworks: * `net8.0` * `net9.0` * `net10.0` ## Package Manager Commands ### Package Manager Console ```powershell theme={"dark"} # Azure Storage Queue Install-Package SimpleMessageBus.Publish.Azure Install-Package SimpleMessageBus.Dispatch.Azure # Amazon SQS Install-Package SimpleMessageBus.Publish.Amazon Install-Package SimpleMessageBus.Dispatch.Amazon # File System Install-Package SimpleMessageBus.Publish Install-Package SimpleMessageBus.Dispatch.FileSystem # IndexedDB (Blazor WebAssembly) Install-Package SimpleMessageBus.Publish.IndexedDb Install-Package SimpleMessageBus.Dispatch.IndexedDb ``` ### PackageReference Add to your `.csproj` file: ```xml theme={"dark"} ``` ## Verification After installation, verify the packages are correctly installed: ```bash theme={"dark"} dotnet list package ``` You should see the SimpleMessageBus packages listed with their version numbers. ## Next Steps After installation, proceed to: Get up and running in 5 minutes Configure your chosen provider ## Troubleshooting ### Common Issues Ensure all SimpleMessageBus packages are using the same version. Use `dotnet list package --outdated` to check for version mismatches. SimpleMessageBus requires .NET 8.0 or later. Update your project's target framework if necessary: ```xml theme={"dark"} net8.0 ``` Some providers have additional dependencies that should be automatically installed. If you encounter missing assembly errors, try restoring packages: ```bash theme={"dark"} dotnet restore ``` For additional help, visit our [GitHub Issues](https://github.com/CloudNimble/SimpleMessageBus/issues) page. # Amazon SQS Provider Source: https://easyaf.dev/simplemessagebus/providers/amazon-sqs Configure SimpleMessageBus with Amazon Simple Queue Service The Amazon SQS provider offers enterprise-grade message queuing with advanced features like FIFO queues, dead letter queues, and long polling. It's ideal for mission-critical applications requiring high reliability and throughput. ## Installation Install the Amazon SQS packages: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.Amazon dotnet add package SimpleMessageBus.Dispatch.Amazon ``` ## Basic Configuration ### Publishing Configuration Configure the publisher in your startup: ```csharp theme={"dark"} using SimpleMessageBus.Publish.Amazon.Extensions; var builder = WebApplication.CreateBuilder(args); builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = "us-east-1"; options.AccessKey = builder.Configuration["AWS:AccessKey"]; options.SecretKey = builder.Configuration["AWS:SecretKey"]; options.DefaultQueueName = "messages"; }); var app = builder.Build(); ``` ### Dispatching Configuration Configure the message dispatcher: ```csharp theme={"dark"} using SimpleMessageBus.Dispatch.Amazon.Extensions; builder.Services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.Region = "us-east-1"; options.AccessKey = builder.Configuration["AWS:AccessKey"]; options.SecretKey = builder.Configuration["AWS:SecretKey"]; options.DefaultQueueName = "messages"; options.MaxConcurrentMessages = 20; options.WaitTimeSeconds = 20; // Long polling }); ``` ## Configuration Options ### AmazonSQSOptions ```csharp theme={"dark"} public class AmazonSQSOptions { // AWS Region public string Region { get; set; } = "us-east-1"; // Authentication - choose one method public string AccessKey { get; set; } public string SecretKey { get; set; } public string SessionToken { get; set; } // For temporary credentials // Alternative: Use IAM roles (recommended for EC2/ECS) public bool UseInstanceProfile { get; set; } = false; // Alternative: Use specific profile public string ProfileName { get; set; } // Default queue name public string DefaultQueueName { get; set; } = "messages"; // Queue URL prefix (optional) public string QueueUrlPrefix { get; set; } } ``` ```csharp theme={"dark"} public class AmazonSQSDispatcherOptions : AmazonSQSOptions { // Maximum messages to retrieve per request (1-10) public int MaxNumberOfMessages { get; set; } = 10; // Long polling wait time (0-20 seconds) public int WaitTimeSeconds { get; set; } = 20; // Message visibility timeout (seconds) public int VisibilityTimeoutSeconds { get; set; } = 300; // Maximum concurrent message processing public int MaxConcurrentMessages { get; set; } = 20; // Enable dead letter queue handling public bool EnableDeadLetterQueue { get; set; } = true; // Dead letter queue suffix public string DeadLetterQueueSuffix { get; set; } = "-dlq"; // Maximum delivery count before DLQ public int MaxDeliveryCount { get; set; } = 3; } ``` ```csharp theme={"dark"} public class AmazonSQSAdvancedOptions { // Use FIFO queues for ordered processing public bool UseFifoQueues { get; set; } = false; // Message group ID for FIFO queues public string MessageGroupId { get; set; } = "default"; // Enable content-based deduplication public bool ContentBasedDeduplication { get; set; } = true; // Custom SQS client configuration public AmazonSQSConfig SqsConfig { get; set; } // Message attributes to include public Dictionary DefaultMessageAttributes { get; set; } // Custom queue name resolver public IQueueNameResolver QueueNameResolver { get; set; } } ``` ## Authentication Methods ### Access Keys (Development) For development environments: ```json theme={"dark"} { "AWS": { "AccessKey": "AKIAIOSFODNN7EXAMPLE", "SecretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "Region": "us-east-1" } } ``` ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.AccessKey = builder.Configuration["AWS:AccessKey"]; options.SecretKey = builder.Configuration["AWS:SecretKey"]; options.Region = builder.Configuration["AWS:Region"]; }); ``` ### IAM Roles (Recommended for Production) For EC2 instances, ECS tasks, or Lambda functions: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = "us-east-1"; options.UseInstanceProfile = true; // Use attached IAM role }); ``` ### Named Profiles Using AWS CLI profiles: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = "us-east-1"; options.ProfileName = "production"; // Profile from ~/.aws/credentials }); ``` ### Temporary Credentials For applications using AWS STS: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = "us-east-1"; options.AccessKey = temporaryCredentials.AccessKey; options.SecretKey = temporaryCredentials.SecretKey; options.SessionToken = temporaryCredentials.SessionToken; }); ``` ## Queue Types ### Standard Queues Default queue type with high throughput: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.DefaultQueueName = "messages"; // Standard queue used by default }); ``` **Characteristics:** * Nearly unlimited throughput * At-least-once delivery * Best-effort ordering * Lower cost ### FIFO Queues For ordered message processing: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.DefaultQueueName = "messages.fifo"; // Must end with .fifo options.UseFifoQueues = true; options.MessageGroupId = "order-processing"; options.ContentBasedDeduplication = true; }); ``` **Characteristics:** * Exactly-once processing * Strict message ordering * 3,000 messages/second with batching * Higher cost ## Dead Letter Queue Configuration ### Automatic DLQ Setup SimpleMessageBus can automatically configure dead letter queues: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.EnableDeadLetterQueue = true; options.MaxDeliveryCount = 3; options.DeadLetterQueueSuffix = "-dlq"; }); ``` ### Manual DLQ Configuration Set up DLQ manually in AWS Console or with Infrastructure as Code: ```json theme={"dark"} { "QueueConfiguration": { "RedrivePolicy": { "deadLetterTargetArn": "arn:aws:sqs:us-east-1:123456789012:messages-dlq", "maxReceiveCount": 3 } } } ``` ### DLQ Message Processing Handle messages from dead letter queue: ```csharp theme={"dark"} public class DeadLetterHandler : IMessageHandler { private readonly ILogger _logger; private readonly IEmailService _emailService; public async Task HandleAsync(FailedMessage message) { _logger.LogCritical("Message failed after max retries: {@Message}", message); // Alert operations team await _emailService.SendAlertAsync( "Dead Letter Queue Alert", $"Message {message.MessageId} failed processing after {message.AttemptCount} attempts" ); // Store for manual investigation await StoreForInvestigation(message); } } ``` ## Message Attributes and Metadata ### Standard Message Attributes SQS supports message attributes for filtering and routing: ```csharp theme={"dark"} public class OrderMessage : IMessage, IMetadataAware { public string OrderId { get; set; } public decimal Amount { get; set; } public Dictionary Metadata { get; set; } = new() { ["Priority"] = "High", ["Source"] = "WebApp", ["Version"] = "2.0" }; } ``` ### Custom Message Attributes Add custom attributes during publishing: ```csharp theme={"dark"} public class CustomSQSPublisher : IMessagePublisher { private readonly AmazonSQSMessagePublisher _basePublisher; public async Task PublishAsync(T message) where T : IMessage { var envelope = new MessageEnvelope { Content = JsonSerializer.Serialize(message), MessageType = typeof(T).FullName, Timestamp = DateTime.UtcNow, Headers = new Dictionary { ["Environment"] = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"), ["MachineName"] = Environment.MachineName, ["ProcessId"] = Environment.ProcessId } }; await _basePublisher.PublishAsync(envelope); } } ``` ## Error Handling and Retry Strategies ### Built-in Retry Logic Configure automatic retries: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.VisibilityTimeoutSeconds = 300; // 5 minutes options.MaxDeliveryCount = 5; // Retry up to 5 times }); ``` ### Custom Error Handling Implement sophisticated error handling: ```csharp theme={"dark"} public class RobustMessageHandler : IMessageHandler { public async Task HandleAsync(OrderMessage message) { try { await ProcessOrder(message); } catch (ValidationException ex) { // Don't retry validation errors - send to DLQ immediately _logger.LogWarning(ex, "Validation error for order {OrderId}", message.OrderId); throw new PermanentFailureException("Validation failed", ex); } catch (HttpRequestException ex) when (IsTransientError(ex)) { // Retry transient HTTP errors _logger.LogWarning(ex, "Transient error processing order {OrderId}", message.OrderId); throw; // Will be retried automatically } catch (Exception ex) { // Log unexpected errors _logger.LogError(ex, "Unexpected error processing order {OrderId}", message.OrderId); throw; } } private bool IsTransientError(HttpRequestException ex) { return ex.Message.Contains("timeout") || ex.Message.Contains("connection") || ex.Message.Contains("502") || ex.Message.Contains("503"); } } ``` ## Monitoring and CloudWatch Integration ### CloudWatch Metrics SQS automatically publishes metrics to CloudWatch: * `ApproximateNumberOfMessages` * `ApproximateNumberOfMessagesVisible` * `NumberOfMessagesSent` * `NumberOfMessagesReceived` * `NumberOfMessagesDeleted` ### Custom Application Metrics Track application-specific metrics: ```csharp theme={"dark"} public class MetricsMessageHandler : IMessageHandler { private readonly IMetrics _metrics; public async Task HandleAsync(OrderMessage message) { using var activity = Activity.StartActivity("ProcessOrder"); activity?.SetTag("order.id", message.OrderId); var timer = Stopwatch.StartNew(); try { await ProcessOrder(message); // Success metrics _metrics.Counter("orders.processed") .WithTag("status", "success") .Add(1); _metrics.Histogram("order.processing.duration") .WithTag("status", "success") .Record(timer.ElapsedMilliseconds); } catch (Exception ex) { // Error metrics _metrics.Counter("orders.processed") .WithTag("status", "error") .WithTag("error.type", ex.GetType().Name) .Add(1); throw; } } } ``` ### X-Ray Tracing Enable AWS X-Ray for distributed tracing: ```csharp theme={"dark"} builder.Services.AddAWSXRayTracing(); public class TracingOrderHandler : IMessageHandler { public async Task HandleAsync(OrderMessage message) { using var segment = AWSXRayRecorder.Instance.BeginSubsegment("ProcessOrder"); segment.AddAnnotation("OrderId", message.OrderId); segment.AddMetadata("Order", message); try { await ProcessOrder(message); segment.AddAnnotation("Status", "Success"); } catch (Exception ex) { segment.AddException(ex); segment.AddAnnotation("Status", "Error"); throw; } } } ``` ## Performance Optimization ### Long Polling Use long polling to reduce costs and latency: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.WaitTimeSeconds = 20; // Maximum long polling time options.MaxNumberOfMessages = 10; // Batch processing }); ``` ### Batch Operations Process messages in batches: ```csharp theme={"dark"} public class BatchOrderProcessor : IMessageHandler { private readonly List _batch = new(); private readonly object _lock = new(); public async Task HandleAsync(OrderMessage message) { bool shouldProcess; lock (_lock) { _batch.Add(message); shouldProcess = _batch.Count >= 10; // Process in batches of 10 } if (shouldProcess) { List currentBatch; lock (_lock) { currentBatch = new List(_batch); _batch.Clear(); } await ProcessBatch(currentBatch); } } private async Task ProcessBatch(List orders) { // Process multiple orders efficiently await _orderService.ProcessOrdersAsync(orders); } } ``` ### Multiple Processors Scale with multiple queue processors: ```csharp theme={"dark"} // Configure multiple processors for high throughput for (int i = 0; i < Environment.ProcessorCount; i++) { builder.Services.AddSimpleMessageBusAmazonSQSDispatcher($"processor-{i}", options => { options.DefaultQueueName = "high-volume-messages"; options.MaxConcurrentMessages = 10; }); } ``` ## Security Best Practices ### IAM Policies Minimal required permissions for publisher: ```json theme={"dark"} { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "sqs:SendMessage", "sqs:GetQueueAttributes" ], "Resource": "arn:aws:sqs:us-east-1:123456789012:messages*" } ] } ``` Minimal required permissions for dispatcher: ```json theme={"dark"} { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "sqs:ReceiveMessage", "sqs:DeleteMessage", "sqs:ChangeMessageVisibility", "sqs:GetQueueAttributes" ], "Resource": "arn:aws:sqs:us-east-1:123456789012:messages*" } ] } ``` ### VPC Endpoints Use VPC endpoints for private communication: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.SqsConfig = new AmazonSQSConfig { ServiceURL = "https://vpce-1234567-abcdefgh.sqs.us-east-1.vpce.amazonaws.com" }; }); ``` ### Message Encryption Enable server-side encryption: ```csharp theme={"dark"} // Configure queue with SSE-SQS (managed keys) // Or SSE-KMS (customer managed keys) // This is done at the queue level in AWS ``` ## Troubleshooting **Symptoms**: `AmazonServiceException` with access denied **Solutions**: * Verify IAM permissions * Check access key and secret key * Ensure correct region * Validate queue ARN format ```csharp theme={"dark"} // Test SQS connection var sqs = new AmazonSQSClient(accessKey, secretKey, RegionEndpoint.USEast1); var queues = await sqs.ListQueuesAsync(); ``` **Symptoms**: `AmazonServiceException` with throttling errors **Solutions**: * Implement exponential backoff * Reduce message rate * Use batch operations * Consider FIFO queue limits ```csharp theme={"dark"} options.RetryPolicy = new ExponentialBackoffRetryPolicy { MaxRetries = 5, BaseDelay = TimeSpan.FromSeconds(1) }; ``` **Symptoms**: `MessageTooLarge` exceptions **Solutions**: * SQS limit: 256 KB * Use S3 for large payloads * Reference S3 objects in messages ```csharp theme={"dark"} public class LargeDataMessage : IMessage { public string S3Bucket { get; set; } public string S3Key { get; set; } public string MessageId { get; set; } } ``` ## Complete Example Here's a complete working example with FIFO queue and DLQ: ```csharp theme={"dark"} // Program.cs using SimpleMessageBus.Publish.Amazon.Extensions; using SimpleMessageBus.Dispatch.Amazon.Extensions; var builder = WebApplication.CreateBuilder(args); // Configure Amazon SQS with FIFO queue builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.Region = "us-east-1"; options.UseInstanceProfile = true; // Use IAM role options.DefaultQueueName = "orders.fifo"; options.UseFifoQueues = true; options.MessageGroupId = "order-processing"; }); builder.Services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.Region = "us-east-1"; options.UseInstanceProfile = true; options.DefaultQueueName = "orders.fifo"; options.UseFifoQueues = true; options.EnableDeadLetterQueue = true; options.MaxDeliveryCount = 3; options.WaitTimeSeconds = 20; // Long polling options.MaxConcurrentMessages = 10; }); // Register handlers builder.Services.AddScoped, OrderCreatedHandler>(); var app = builder.Build(); // API endpoint app.MapPost("/orders", async (CreateOrderRequest request, IMessagePublisher publisher) => { var orderId = Guid.NewGuid().ToString(); await publisher.PublishAsync(new OrderCreatedMessage { OrderId = orderId, CustomerId = request.CustomerId, TotalAmount = request.TotalAmount, CreatedAt = DateTime.UtcNow }); return Results.Ok(new { OrderId = orderId }); }); app.Run(); ``` ## Next Steps Learn about ordered message processing Handle failed messages effectively Monitor your SQS integration Optimize for high throughput # Azure Storage Queue Provider Source: https://easyaf.dev/simplemessagebus/providers/azure-storage-queue Configure SimpleMessageBus with Azure Storage Queues The Azure Storage Queue provider offers a cost-effective, reliable messaging solution for applications using the Azure ecosystem. It's perfect for high-volume scenarios where message ordering is not critical. ## Installation Install the Azure Storage Queue packages: ```bash theme={"dark"} dotnet add package SimpleMessageBus.Publish.Azure dotnet add package SimpleMessageBus.Dispatch.Azure ``` ## Basic Configuration ### Publishing Configuration Configure the publisher in your startup: ```csharp theme={"dark"} using SimpleMessageBus.Publish.Azure.Extensions; var builder = WebApplication.CreateBuilder(args); builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); options.DefaultQueueName = "messages"; }); var app = builder.Build(); ``` ### Dispatching Configuration Configure the message dispatcher: ```csharp theme={"dark"} using SimpleMessageBus.Dispatch.Azure.Extensions; builder.Services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); options.DefaultQueueName = "messages"; options.PollingInterval = TimeSpan.FromSeconds(5); options.MaxConcurrentMessages = 32; }); ``` ## Configuration Options ### AzureStorageQueueOptions ```csharp theme={"dark"} public class AzureStorageQueueOptions { // Connection string to Azure Storage account public string ConnectionString { get; set; } // Alternative: Use individual components public string AccountName { get; set; } public string AccountKey { get; set; } public string SasToken { get; set; } // Default queue name if not specified per message public string DefaultQueueName { get; set; } = "messages"; // Whether to create queues automatically public bool CreateQueuesAutomatically { get; set; } = true; } ``` ```csharp theme={"dark"} public class AzureStorageQueueDispatcherOptions : AzureStorageQueueOptions { // How often to poll for new messages public TimeSpan PollingInterval { get; set; } = TimeSpan.FromSeconds(5); // Maximum messages to retrieve per poll public int BatchSize { get; set; } = 32; // Maximum concurrent message processing public int MaxConcurrentMessages { get; set; } = 32; // Message visibility timeout public TimeSpan VisibilityTimeout { get; set; } = TimeSpan.FromMinutes(5); // Maximum retry attempts for failed messages public int MaxRetryAttempts { get; set; } = 3; // Delay between retry attempts public TimeSpan RetryDelay { get; set; } = TimeSpan.FromSeconds(30); } ``` ```csharp theme={"dark"} public class AzureStorageQueueAdvancedOptions { // Custom queue name resolver public IQueueNameResolver QueueNameResolver { get; set; } // Message serialization options public JsonSerializerOptions SerializerOptions { get; set; } // Enable poison message handling public bool EnablePoisonMessageHandling { get; set; } = true; // Poison message queue suffix public string PoisonQueueSuffix { get; set; } = "-poison"; // Message time-to-live public TimeSpan? MessageTimeToLive { get; set; } } ``` ## Connection String Formats Azure Storage supports multiple connection string formats: ### Standard Connection String ```json theme={"dark"} { "ConnectionStrings": { "AzureStorage": "DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey;EndpointSuffix=core.windows.net" } } ``` ### Managed Identity (Recommended for Production) ```json theme={"dark"} { "ConnectionStrings": { "AzureStorage": "DefaultEndpointsProtocol=https;AccountName=myaccount;EndpointSuffix=core.windows.net" } } ``` Configure managed identity in your application: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); // Managed identity will be used automatically }); ``` ### Development Storage Emulator For local development with Azurite: ```json theme={"dark"} { "ConnectionStrings": { "AzureStorage": "UseDevelopmentStorage=true" } } ``` ## Queue Naming Strategies ### Default Queue Names Use a default queue for all messages: ```csharp theme={"dark"} options.DefaultQueueName = "simplemessagebus-messages"; ``` ### Custom Queue Name Resolver Implement custom queue naming logic: ```csharp theme={"dark"} public class CustomQueueNameResolver : IQueueNameResolver { public string ResolveQueueName(T message) where T : IMessage { // Route by message type return typeof(T).Name.ToLowerInvariant() + "-queue"; } public string ResolveQueueName(Type messageType) { return messageType.Name.ToLowerInvariant() + "-queue"; } } // Register the resolver builder.Services.AddSingleton(); ``` ### Environment-Based Naming Include environment in queue names: ```csharp theme={"dark"} var environment = builder.Environment.EnvironmentName.ToLowerInvariant(); options.DefaultQueueName = $"messages-{environment}"; ``` ## Message Handling Patterns ### Simple Handler ```csharp theme={"dark"} public class OrderProcessedHandler : IMessageHandler { private readonly ILogger _logger; public OrderProcessedHandler(ILogger logger) { _logger = logger; } public async Task HandleAsync(OrderProcessedMessage message) { _logger.LogInformation("Processing order {OrderId}", message.OrderId); // Your processing logic here await ProcessOrder(message); } } ``` ### Error Handling ```csharp theme={"dark"} public class RobustOrderHandler : IMessageHandler { public async Task HandleAsync(OrderMessage message) { try { await ProcessOrder(message); } catch (ValidationException ex) { // Don't retry validation errors _logger.LogWarning(ex, "Validation failed for order {OrderId}", message.OrderId); return; // Message will be marked as processed } catch (HttpRequestException ex) { // Retry transient HTTP errors _logger.LogError(ex, "HTTP error processing order {OrderId}", message.OrderId); throw; // Message will be retried } } } ``` ## Azure Functions Integration ### Queue Trigger Function Use Azure Functions with Storage Queue triggers: ```csharp theme={"dark"} public class QueueFunctions { private readonly IMessageDispatcher _dispatcher; public QueueFunctions(IMessageDispatcher dispatcher) { _dispatcher = dispatcher; } [FunctionName("ProcessMessage")] public async Task ProcessMessage( [QueueTrigger("messages")] CloudQueueMessage queueMessage, ILogger log) { try { var envelope = JsonSerializer.Deserialize(queueMessage.AsString); await _dispatcher.DispatchAsync(envelope); } catch (Exception ex) { log.LogError(ex, "Failed to process message {MessageId}", queueMessage.Id); throw; } } } ``` ### Function Startup Configuration ```csharp theme={"dark"} [assembly: FunctionsStartup(typeof(Startup))] public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder builder) { builder.Services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage"); }); // Register message handlers builder.Services.AddScoped, OrderHandler>(); } } ``` ## Monitoring and Observability ### Built-in Logging SimpleMessageBus logs important events: ```csharp theme={"dark"} builder.Services.AddLogging(logging => { logging.AddConsole(); logging.AddApplicationInsights(); }); ``` ### Custom Metrics Track custom metrics: ```csharp theme={"dark"} public class MetricsOrderHandler : IMessageHandler { private readonly IMetrics _metrics; public async Task HandleAsync(OrderMessage message) { using var activity = _metrics.StartActivity("ProcessOrder"); activity?.SetTag("order.id", message.OrderId); var stopwatch = Stopwatch.StartNew(); try { await ProcessOrder(message); _metrics.Counter("orders.processed").Add(1); } catch (Exception) { _metrics.Counter("orders.failed").Add(1); throw; } finally { _metrics.Histogram("orders.duration").Record(stopwatch.ElapsedMilliseconds); } } } ``` ## Performance Optimization ### Batch Processing Process multiple messages efficiently: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.BatchSize = 32; // Retrieve up to 32 messages per poll options.MaxConcurrentMessages = 64; // Process up to 64 messages concurrently options.PollingInterval = TimeSpan.FromSeconds(1); // Poll more frequently }); ``` ### Connection Pooling Azure Storage client automatically pools connections, but you can optimize: ```csharp theme={"dark"} builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = connectionString; // The client will automatically use connection pooling }); ``` ## Security Best Practices ### Managed Identity (Recommended) Use Azure Managed Identity instead of connection strings: ```csharp theme={"dark"} // In Azure, configure managed identity builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.AccountName = "mystorageaccount"; // No connection string needed - managed identity used automatically }); ``` ### Least Privilege Access Configure minimal required permissions: * **Publisher**: `Storage Queue Data Message Sender` * **Dispatcher**: `Storage Queue Data Message Processor` ### Network Security Use private endpoints and VNets: ```csharp theme={"dark"} options.ConnectionString = "DefaultEndpointsProtocol=https;AccountName=myaccount;QueueEndpoint=https://myaccount.privatelink.queue.core.windows.net/;SharedAccessSignature=..."; ``` ## Troubleshooting **Symptoms**: `StorageException` with authentication errors **Solutions**: * Verify connection string format * Check account name and key * Ensure storage account exists * Verify network connectivity ```csharp theme={"dark"} // Test connection var client = new QueueServiceClient(connectionString); var queues = await client.GetQueuesAsync().ToListAsync(); ``` **Symptoms**: Slow message processing, high latency **Solutions**: * Increase `MaxConcurrentMessages` * Reduce `PollingInterval` * Increase `BatchSize` * Use multiple queue processors ```csharp theme={"dark"} options.MaxConcurrentMessages = Environment.ProcessorCount * 4; options.BatchSize = 32; options.PollingInterval = TimeSpan.FromSeconds(1); ``` **Symptoms**: `RequestEntityTooLarge` exceptions **Solutions**: * Azure Storage Queue limit: 64 KB * Store large payloads in Blob Storage * Reference blobs in messages ```csharp theme={"dark"} public class LargeMessage : IMessage { public string BlobUrl { get; set; } // Reference to blob public string MessageId { get; set; } } ``` ## Complete Example Here's a complete working example: ```csharp theme={"dark"} // Program.cs using SimpleMessageBus.Publish.Azure.Extensions; using SimpleMessageBus.Dispatch.Azure.Extensions; var builder = WebApplication.CreateBuilder(args); // Configure Azure Storage Queue builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); options.DefaultQueueName = "orders"; }); builder.Services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); options.DefaultQueueName = "orders"; options.MaxConcurrentMessages = 16; options.PollingInterval = TimeSpan.FromSeconds(2); }); // Register handlers builder.Services.AddScoped, OrderCreatedHandler>(); var app = builder.Build(); // API endpoint app.MapPost("/orders", async (CreateOrderRequest request, IMessagePublisher publisher) => { var orderId = Guid.NewGuid().ToString(); // Publish message await publisher.PublishAsync(new OrderCreatedMessage { OrderId = orderId, CustomerId = request.CustomerId, TotalAmount = request.TotalAmount, CreatedAt = DateTime.UtcNow }); return Results.Ok(new { OrderId = orderId }); }); app.Run(); ``` ## Next Steps Learn message design best practices Implement robust error handling Test your Azure Storage Queue integration Optimize for high throughput # Providers Overview Source: https://easyaf.dev/simplemessagebus/providers/overview Choose the right message transport provider for your needs SimpleMessageBus supports multiple transport providers, allowing you to choose the best option for your infrastructure and requirements. Each provider has its own strengths and is optimized for specific scenarios. ## Available Providers Reliable, cost-effective queuing using Azure Storage Fully managed message queuing service from AWS Local file-based messaging for development and on-premises Client-side messaging for Blazor WebAssembly applications ## Provider Comparison
Feature Azure Storage Amazon SQS File System IndexedDB
**Cost** Very Low Low Free Free
**Scalability** High Very High Limited Limited
**Reliability** High Very High Medium Medium
**Latency** Low Very Low Very Low Very Low
**Setup Complexity** Low Medium Very Low Low
**Platform Support** All All All Browser Only
## Choosing a Provider ### Azure Storage Queue **Best for:** * Applications already using Azure ecosystem * Cost-sensitive scenarios (very affordable) * High-volume, low-complexity messaging * Integration with Azure Functions **Limitations:** * 64KB message size limit * Basic message ordering (FIFO not guaranteed) * No advanced routing features **Example Use Cases:** * Background job processing * Event notifications * Simple workflow coordination ### Amazon SQS **Best for:** * Applications in AWS ecosystem * Mission-critical applications requiring high reliability * Complex messaging patterns with DLQ support * Applications requiring message ordering (FIFO queues) **Limitations:** * Higher cost than Azure Storage * More complex IAM configuration * AWS-specific features and terminology **Example Use Cases:** * Microservices communication * Order processing systems * High-volume transaction processing ### File System **Best for:** * Development and testing * On-premises deployments * Simple applications with low message volume * Azure Functions with custom triggers **Limitations:** * Not suitable for production at scale * No built-in redundancy * Platform-dependent file locking **Example Use Cases:** * Local development * Simple background processing * File-based integrations * Proof of concepts ### IndexedDB **Best for:** * Blazor WebAssembly applications * Client-side background processing * Offline-capable applications * Browser-based workflows **Limitations:** * Browser storage quotas * Single-user scenarios only * No cross-browser synchronization * Limited to WebAssembly context **Example Use Cases:** * Client-side data processing * Offline message queuing * Browser-based workflows * Progressive Web Apps (PWAs) ## Multi-Provider Architecture You can use multiple providers in the same application for different scenarios: ```csharp theme={"dark"} // Configure multiple publishers services.AddSimpleMessageBusAzureStoragePublisher("primary", options => { options.ConnectionString = azureConnectionString; }); services.AddSimpleMessageBusFileSystemPublisher("local", options => { options.RootPath = localPath; }); // Use named publishers public class OrderService { private readonly IMessagePublisher _primaryPublisher; private readonly IMessagePublisher _localPublisher; public OrderService( [FromKeyedServices("primary")] IMessagePublisher primaryPublisher, [FromKeyedServices("local")] IMessagePublisher localPublisher) { _primaryPublisher = primaryPublisher; _localPublisher = localPublisher; } } ``` ## Migration Between Providers SimpleMessageBus makes it easy to migrate between providers: 1. **Add the new provider** alongside the existing one 2. **Gradually migrate message types** to the new provider 3. **Update handlers** to process from both providers during transition 4. **Remove the old provider** once migration is complete ```csharp theme={"dark"} // Phase 1: Add new provider services.AddSimpleMessageBusAmazonSQSPublisher(newOptions); services.AddSimpleMessageBusAzureStoragePublisher(oldOptions); // Phase 2: Dual publishing during migration await _newPublisher.PublishAsync(message); await _oldPublisher.PublishAsync(message); // Remove when ready // Phase 3: Remove old provider services.RemoveSimpleMessageBusAzureStorage(); ``` ## Provider-Specific Features Each provider offers unique features that you can leverage: ### Azure Storage Queue Features * **Poison message handling**: Automatic dead letter queue support * **Message TTL**: Configurable time-to-live for messages * **Peek operations**: Non-destructive message inspection * **Batch operations**: Process multiple messages efficiently ### Amazon SQS Features * **FIFO queues**: Guaranteed message ordering * **Message deduplication**: Automatic duplicate detection * **Dead letter queues**: Sophisticated error handling * **Long polling**: Efficient message retrieval ### File System Features * **Azure Functions triggers**: Custom trigger bindings * **File watching**: Real-time processing of new files * **Structured storage**: Organized file hierarchies * **Cross-platform compatibility**: Works on all operating systems ### IndexedDB Features * **Offline support**: Works without network connectivity * **Large storage**: Gigabytes of client-side storage * **Transaction support**: ACID properties for data integrity * **Asynchronous operations**: Non-blocking browser operations ## Configuration Patterns ### Environment-Based Configuration Use different providers based on environment: ```csharp theme={"dark"} if (builder.Environment.IsDevelopment()) { builder.Services.AddSimpleMessageBusFileSystemProvider(); } else if (builder.Environment.IsProduction()) { builder.Services.AddSimpleMessageBusAzureStorageProvider(); } ``` ### Feature Flag Configuration Use feature flags to switch providers: ```csharp theme={"dark"} var useAmazonSQS = builder.Configuration.GetValue("Features:UseAmazonSQS"); if (useAmazonSQS) { builder.Services.AddSimpleMessageBusAmazonSQSProvider(); } else { builder.Services.AddSimpleMessageBusAzureStorageProvider(); } ``` ## Next Steps Choose your provider and dive into the detailed configuration: Configure Azure Storage Queue provider Set up Amazon SQS provider Use File System provider Implement IndexedDB provider # Getting Started with SimpleMessageBus Source: https://easyaf.dev/simplemessagebus/quickstart Get up and running quickly is as easy as 1-2-3. Get SimpleMessageBus working in your application with just a few simple steps. ## Step 1: Install the Package Choose the provider that matches your infrastructure: ```bash Azure Storage Queue theme={"dark"} dotnet add package SimpleMessageBus.Publish.Azure dotnet add package SimpleMessageBus.Dispatch.Azure ``` ```bash Amazon SQS theme={"dark"} dotnet add package SimpleMessageBus.Publish.Amazon dotnet add package SimpleMessageBus.Dispatch.Amazon ``` ```bash File System theme={"dark"} dotnet add package SimpleMessageBus.Publish dotnet add package SimpleMessageBus.Dispatch.FileSystem ``` ```bash Blazor WebAssembly theme={"dark"} dotnet add package SimpleMessageBus.Publish.IndexedDb dotnet add package SimpleMessageBus.Dispatch.IndexedDb ``` ## Step 2: Define Your Message Create a message class that implements `IMessage`: ```csharp theme={"dark"} using SimpleMessageBus.Core; public class UserCreatedMessage : IMessage { public string UserId { get; set; } public string Email { get; set; } public DateTime CreatedAt { get; set; } } ``` ## Step 3: Create a Message Handler Implement `IMessageHandler` to process your messages: ```csharp theme={"dark"} using SimpleMessageBus.Core; public class UserCreatedHandler : IMessageHandler { private readonly ILogger _logger; public UserCreatedHandler(ILogger logger) { _logger = logger; } public async Task HandleAsync(UserCreatedMessage message) { _logger.LogInformation("User created: {UserId} - {Email}", message.UserId, message.Email); // Process the message (send welcome email, update database, etc.) await ProcessUserCreation(message); } private async Task ProcessUserCreation(UserCreatedMessage message) { // Your business logic here await Task.Delay(100); // Simulate processing } } ``` ## Step 4: Configure Services Add SimpleMessageBus to your dependency injection container: ```csharp Azure Storage Queue theme={"dark"} using SimpleMessageBus.Publish.Azure.Extensions; using SimpleMessageBus.Dispatch.Azure.Extensions; var builder = WebApplication.CreateBuilder(args); // Configure Azure Storage Queue builder.Services.AddSimpleMessageBusAzureStoragePublisher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); }); builder.Services.AddSimpleMessageBusAzureStorageDispatcher(options => { options.ConnectionString = builder.Configuration.GetConnectionString("AzureStorage"); }); // Register your message handler builder.Services.AddScoped, UserCreatedHandler>(); var app = builder.Build(); ``` ```csharp Amazon SQS theme={"dark"} using SimpleMessageBus.Publish.Amazon.Extensions; using SimpleMessageBus.Dispatch.Amazon.Extensions; var builder = WebApplication.CreateBuilder(args); // Configure Amazon SQS builder.Services.AddSimpleMessageBusAmazonSQSPublisher(options => { options.AccessKey = builder.Configuration["AWS:AccessKey"]; options.SecretKey = builder.Configuration["AWS:SecretKey"]; options.Region = "us-east-1"; }); builder.Services.AddSimpleMessageBusAmazonSQSDispatcher(options => { options.AccessKey = builder.Configuration["AWS:AccessKey"]; options.SecretKey = builder.Configuration["AWS:SecretKey"]; options.Region = "us-east-1"; }); // Register your message handler builder.Services.AddScoped, UserCreatedHandler>(); var app = builder.Build(); ``` ```csharp File System theme={"dark"} using SimpleMessageBus.Publish.Extensions; using SimpleMessageBus.Dispatch.FileSystem.Extensions; var builder = WebApplication.CreateBuilder(args); // Configure File System builder.Services.AddSimpleMessageBusFileSystemPublisher(options => { options.RootPath = Path.Combine(Directory.GetCurrentDirectory(), "messages"); }); builder.Services.AddSimpleMessageBusFileSystemDispatcher(options => { options.RootPath = Path.Combine(Directory.GetCurrentDirectory(), "messages"); }); // Register your message handler builder.Services.AddScoped, UserCreatedHandler>(); var app = builder.Build(); ``` ```csharp Blazor WebAssembly theme={"dark"} using SimpleMessageBus.Publish.IndexedDb.Extensions; using SimpleMessageBus.Dispatch.IndexedDb.Extensions; var builder = WebAssemblyHostBuilder.CreateDefault(args); // Configure IndexedDB builder.Services.AddSimpleMessageBusIndexedDbPublisher(); builder.Services.AddSimpleMessageBusIndexedDbDispatcher(); // Register your message handler builder.Services.AddScoped, UserCreatedHandler>(); await builder.Build().RunAsync(); ``` ## Step 5: Publish Messages Inject `IMessagePublisher` and publish messages: ```csharp theme={"dark"} public class UserController : ControllerBase { private readonly IMessagePublisher _messagePublisher; public UserController(IMessagePublisher messagePublisher) { _messagePublisher = messagePublisher; } [HttpPost] public async Task CreateUser([FromBody] CreateUserRequest request) { // Create the user (your business logic) var userId = await CreateUserInDatabase(request); // Publish the message var message = new UserCreatedMessage { UserId = userId, Email = request.Email, CreatedAt = DateTime.UtcNow }; await _messagePublisher.PublishAsync(message); return Ok(new { UserId = userId }); } } ``` ## Step 6: Start Processing The message dispatcher will automatically start processing messages when your application starts. For Azure Functions or console applications, you might need additional configuration. For Azure Functions, see the [Azure Functions guide](/simplemessagebus/guides/azure-functions) for trigger-based message processing. ## Next Steps Congratulations! You now have SimpleMessageBus running in your application. Here are some next steps: Understand messages, publishers, and handlers Deep dive into provider-specific configuration Learn how to test your message handlers Explore the complete API documentation ## Example Application For a complete working example, check out our [sample applications](https://github.com/CloudNimble/SimpleMessageBus/tree/main/src/SimpleMessageBus.Samples) on GitHub. # Why EasyAF? Source: https://easyaf.dev/why-easyaf by Robert McLaws - Former Microsoft MVP and CEO of CloudNimble