Class EfCoreAggregateDataSource
- Namespace
- Savvyio.Extensions.EFCore.Domain
- Assembly
- Savvyio.Extensions.EFCore.Domain.dll
Provides an implementation of the EfCoreDataSource that is optimized for Domain Driven Design and the concept of Aggregate Root.
public class EfCoreAggregateDataSource : EfCoreDataSource, IDisposable, IEfCoreDataSource, IDataSource, IUnitOfWork
- Inheritance
-
EfCoreAggregateDataSource
- Implements
- Derived
- Inherited Members
Constructors
EfCoreAggregateDataSource(IDomainEventDispatcher, DbContext)
Initializes a new instance of the EfCoreAggregateDataSource class.
protected EfCoreAggregateDataSource(IDomainEventDispatcher dispatcher, DbContext dbContext)
Parameters
dispatcherIDomainEventDispatcherThe IDomainEventDispatcher that are responsible for raising domain events.
dbContextDbContextThe DbContext to associate with this data store.
EfCoreAggregateDataSource(IDomainEventDispatcher, EfCoreDataSourceOptions)
Initializes a new instance of the EfCoreAggregateDataSource class.
public EfCoreAggregateDataSource(IDomainEventDispatcher dispatcher, EfCoreDataSourceOptions options)
Parameters
dispatcherIDomainEventDispatcherThe IDomainEventDispatcher that are responsible for raising domain events.
optionsEfCoreDataSourceOptionsThe EfCoreDataSourceOptions used to configure this instance.
Methods
SaveChangesAsync(Action<AsyncOptions>)
Saves the different IRepository<TEntity, TKey> implementations as one transaction towards a data store asynchronous.
public override Task SaveChangesAsync(Action<AsyncOptions> setup = null)
Parameters
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
Remarks
Will, just before SaveChangesAsync(CancellationToken) is called, extract and call RaiseAsync(IDomainEvent, Action<AsyncOptions>) for all aggregate roots contained within the backing DbContext.