Show / Hide Table of Contents

Class DependentEntityCollection<T>

Collection of dependent child entities. Primarily used for triggering logic before save and after save events.

Inheritance
object
DependentEntityCollection<T>
Implements
IDependentEntityCollection
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 Source

DependentEntityCollection(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 Source

AfterSave()

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()
| Edit this page View Source

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

Implements

IDependentEntityCollection
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com