Table of Contents

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

dispatcher IDomainEventDispatcher

The IDomainEventDispatcher that are responsible for raising domain events.

dbContext DbContext

The 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

dispatcher IDomainEventDispatcher

The IDomainEventDispatcher that are responsible for raising domain events.

options EfCoreDataSourceOptions

The 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

setup Action<AsyncOptions>

The AsyncOptions which may be configured.

Returns

Task

A Task that represents the asynchronous operation.

Remarks

Will, just before SaveChangesAsync(CancellationToken) is called, extract and call RaiseAsync(IDomainEvent, Action<AsyncOptions>) for all aggregate roots contained within the backing DbContext.

See Also