Namespace Savvyio.Extensions.DependencyInjection.EFCore
One DI call to configure both the DbContext and the Savvy I/O data layer is the goal of this namespace. AddEfCoreDataSource<TMarker>, AddEfCoreDataStore<T>, and AddEfCoreRepository<TEntity, TKey> wire up Entity Framework Core persistence without boilerplate.
Start with AddEfCoreDataSource<TMarker> to register the DbContext and the IEfCoreDataSource. Then add AddEfCoreRepository<TEntity, TKey> or AddEfCoreDataStore<T> for each repository or data store. For domain aggregates with explicit boundaries, prefer Savvyio.Extensions.DependencyInjection.EFCore.Domain.
Availability: .NET 10 and .NET 9
Extension Members
| Type | Ext | Methods |
|---|---|---|
| IServiceCollection | ⬇️ | AddEfCoreDataSource, AddEfCoreDataSource<TMarker>, AddEfCoreDataStore<T>, AddEfCoreDataStore<T, TMarker>, AddEfCoreRepository<TEntity, TKey>, AddEfCoreRepository<TEntity, TKey, TMarker> |
Classes
EfCoreDataSourceOptions<TMarker>
Configuration options for IEfCoreDataSource<TMarker>.
EfCoreDataSource<TMarker>
Provides a default implementation of the IEfCoreDataSource<TMarker> interface to support multiple implementations that does the actual I/O communication with a source of data using Microsoft Entity Framework Core.
EfCoreDataStore<T, TMarker>
Provides a default implementation of the IPersistentDataStore<T, TOptions, TMarker> interface to support multiple implementations that serves as an abstraction layer before the actual I/O communication with a source of data using Microsoft Entity Framework Core.
EfCoreDbContext<TMarker>
Provides a default implementation of the DbContext class to support Savvy I/O extensions of Microsoft Entity Framework Core in multiple implementations.
EfCoreRepository<TEntity, TKey, TMarker>
Provides a default implementation of the IPersistentRepository<TEntity, TKey, TMarker> interface to support multiple implementations that serves as an abstraction layer before the actual I/O communication with a source of data using Microsoft Entity Framework Core.
ServiceCollectionExtensions
Extension methods for the IServiceCollection interface.
Interfaces
IEfCoreDataSource<TMarker>
Defines a generic way to support multiple implementations that does the actual I/O communication with a source of data using Microsoft Entity Framework Core.