Class DependentEntityCollection<T>
Collection of dependent child entities. Primarily used for triggering logic before save and after save events.
Implements
Inherited Members
Namespace: Benday.EfCore.SqlServer
Assembly: Benday.EfCore.SqlServer.dll
Syntax
public class DependentEntityCollection<T> : IDependentEntityCollection where T : class, IEntityBase
Type Parameters
Name | Description |
---|---|
T | Data type for entities |
Constructors
| Edit this page View SourceDependentEntityCollection(IList<T>)
Constructor
Declaration
public DependentEntityCollection(IList<T> entities)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | entities | Dependent entity instances |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
Methods
| Edit this page View SourceAfterSave()
Logic to run after a save operation has completed successfully. By default, this looks for entities that were marked for deletion and removes them from the in-memory list of entities.
Declaration
public void AfterSave()
BeforeSave(DbContext)
Logic to run before a save operation. By default this method looks for any wrapped dependent entities that are marked for delete and issues a Remove() call on the data context.
Declaration
public void BeforeSave(DbContext dbContext)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | EF Core DbContext for the save operation |