Table of Contents

Namespace Savvyio.Extensions.EFCore.Domain

Assembly: Savvyio.Extensions.EFCore.Domain.dll

Aggregate roots require their own persistence boundary in DDD. The Savvyio.Extensions.EFCore.Domain namespace provides EfCoreAggregateRepository and EfCoreAggregateDataSource for EF Core–backed aggregate persistence, and DomainEventDispatcherExtensions to dispatch accumulated domain events after the aggregate is saved.

Start with EfCoreAggregateRepository<TAggregateRoot, TKey, TContext> as the base class for aggregate root repositories. Extend it and inject IDomainEventDispatcher, then call RaiseManyAsync<T> after saving to dispatch accumulated domain events. Register with Savvyio.Extensions.DependencyInjection.EFCore.Domain. For event-sourced aggregates, use Savvyio.Extensions.EFCore.Domain.EventSourcing.

Availability: .NET 10 and .NET 9

Extension Members

Type Ext Methods
IDomainEventDispatcher ⬇️ RaiseMany, RaiseManyAsync

Classes

DomainEventDispatcherExtensions

Extension methods for the IDomainEventDispatcher interface.

EfCoreAggregateDataSource

Provides an implementation of the EfCoreDataSource that is optimized for Domain Driven Design and the concept of Aggregate Root.

EfCoreAggregateRepository<TEntity, TKey>

Provides an implementation of the EfCoreRepository<TEntity, TKey> that is optimized for Domain Driven Design.