Namespace Savvyio.Extensions.DependencyInjection.Domain
Registering DDD aggregate repositories in the DI container is done through this namespace. It provides AddAggregateRepository<TService, TEntity, TKey>, AddRepository<TService, TEntity, TKey>, and AddUnitOfWork<TService> for binding aggregate and read-model repository contracts to their implementations.
Start with AddAggregateRepository<TService, TEntity, TKey> to register the primary aggregate repository. Use AddUnitOfWork<TService> when your domain layer requires a unit-of-work coordinator. For event-sourced aggregates, add Savvyio.Extensions.DependencyInjection.Domain.EventSourcing. For EF Core–backed implementations, prefer Savvyio.Extensions.DependencyInjection.EFCore.Domain.
Availability: .NET 10 and .NET 9
Extension Members
| Type | Ext | Methods |
|---|---|---|
| IServiceCollection | ⬇️ | AddAggregateRepository<TService, TEntity, TKey>, AddRepository<TService, TEntity, TKey>, AddUnitOfWork<TService> |
Classes
ServiceCollectionExtensions
Extension methods for the IServiceCollection interface.
Interfaces
IAggregateRepository<TEntity, TKey, TMarker>
Defines a generic way to support multiple implementations of persistent repositories (CRUD) that is optimized for Domain Driven Design.
IDeletableRepository<TEntity, TKey, TMarker>
Defines a generic way to support multiple implementations of deletable repositories (cruD).
IPersistentRepository<TEntity, TKey, TMarker>
Defines a generic way to support multiple implementations of persistent repositories (CRUD).
IReadableRepository<TEntity, TKey, TMarker>
Defines a generic way to support multiple implementations of readable repositories (cRud).
IRepository<TEntity, TKey, TMarker>
Defines a generic way to support multiple implementations of persistent data access based on the Repository pattern.
ISearchableRepository<TEntity, TKey, TMarker>
Defines a generic way to support multiple implementations of searchable repositories (cRud).
IUnitOfWork<TMarker>
Defines a generic way to support multiple implementations that bundles transactions from multiple IPersistentRepository<TEntity, TKey> calls into a single unit.
IWritableRepository<TEntity, TKey, TMarker>
Defines a generic way to support multiple implementations of writable repositories (CrUd).