Definition
Assembly: CloudNimble.EasyAF.Business.EF6.dll Namespace: CloudNimble.EasyAF.Business Inheritance: CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Summary
Provides a specialized entity manager for entities that implement IIdentifiable<TId>. Automatically generates GUID identifiers for entities with empty IDs during insertion.Type Parameters
TContext- The 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.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
dataContext | TContext | The 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<TContext, TEntity>EntityManager2` class.
Syntax
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<TContext>ManagerBase1` class.
Syntax
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
objectSyntax
Properties
DataContext Inherited
Inherited from
CloudNimble.EasyAF.Business.ManagerBase<TContext>Syntax
Property Value
Type:TContext
MessagePublisher Inherited
Inherited from
CloudNimble.EasyAF.Business.ManagerBase<TContext>Syntax
Property Value
Type:CloudNimble.SimpleMessageBus.Publish.IMessagePublisher
Methods
DeleteAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entity | TEntity | - |
save | bool | - |
Returns
Type:System.Threading.Tasks.Task<bool>
DeleteAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entity | TEntity | - |
context | TContext | - |
save | bool | - |
Returns
Type:System.Threading.Tasks.Task<bool>
DeleteAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | - |
save | bool | - |
Returns
Type:System.Threading.Tasks.Task<bool>
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<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | - |
context | TContext | - |
save | bool | - |
Returns
Type:System.Threading.Tasks.Task<bool>
DirectDelete Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
predicate | System.Linq.Expressions.Expression<System.Func<TEntity, bool>> | An Expression1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet1 |
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<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
predicate | System.Linq.Expressions.Expression<System.Func<TEntity, bool>> | An Expression1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet1 |
Returns
Type:System.Threading.Tasks.Task<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.DirectUpdate Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
predicate | System.Linq.Expressions.Expression<System.Func<TEntity, bool>> | An Expression1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet1 |
updateExpression | System.Linq.Expressions.Expression<System.Func<TEntity, TEntity>> | An 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<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
predicate | System.Linq.Expressions.Expression<System.Func<TEntity, bool>> | An Expression1](https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1) to execute against the [DbSet1 |
updateExpression | System.Linq.Expressions.Expression<System.Func<TEntity, TEntity>> | An Expression`1 defining the updates to be performed on the records returned by the predicate. |
Returns
Type:System.Threading.Tasks.Task<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.Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
InsertAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
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<bool>
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<TContext, TEntity>Syntax
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<bool>
True if the entity was successfully inserted; otherwise, false.
InsertAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | 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<bool>
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<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | 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<bool>
True if the entities were successfully inserted; otherwise, false.
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
OnDeletedAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entity | TEntity | The entity that was deleted. |
Returns
Type:System.Threading.Tasks.Task<bool>
True if post-deletion processing was successful; otherwise, false.
OnDeletedAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | The collection of entities that were deleted. |
Returns
Type:System.Threading.Tasks.Task
OnDeletingAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
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<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | The collection of entities to be deleted. |
Returns
Type:System.Threading.Tasks.Task
OnInsertedAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entity | TEntity | The entity that was inserted. |
Returns
Type:System.Threading.Tasks.Task<bool>
True if post-insertion processing was successful; otherwise, false.
OnInsertedAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | 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
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<TContext, TEntity>Syntax
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
ICreatorTrackable1` - DateCreated for entities implementing ICreatedAuditable Override this method to add custom business logic before insertion.
OnInsertingAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | The collection of entities to be inserted. |
Returns
Type:System.Threading.Tasks.Task
OnUpdatedAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entity | TEntity | The entity that was updated. |
Returns
Type:System.Threading.Tasks.Task<bool>
True if post-update processing was successful; otherwise, false.
OnUpdatedAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | The collection of entities that were updated. |
Returns
Type:System.Threading.Tasks.Task
OnUpdatingAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
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
IUpdaterTrackable1` - DateUpdated for entities implementing IUpdatedAuditable Override this method to add custom business logic before updating.
OnUpdatingAsync Inherited Virtual
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | The collection of entities to be updated. |
Returns
Type:System.Threading.Tasks.Task
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ResetAuditProperties Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entity | TDbObservable | The entity whose audit properties should be reset. |
Type Parameters
TDbObservable- Any DbObservableObject in the object model. DOES NOT have to be the entity for this Manager.
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
UpdateAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
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<bool>
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<TContext, TEntity>Syntax
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<bool>
True if the entity was successfully updated; otherwise, false.
UpdateAsync Inherited
Inherited from
CloudNimble.EasyAF.Business.EntityManager<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | 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<bool>
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<TContext, TEntity>Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entities | System.Collections.Generic.List<TEntity> | 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<bool>
True if the entities were successfully updated; otherwise, false.