Class ServiceCollectionExtensions
- Namespace
- Savvyio.Extensions.DependencyInjection.EFCore.Domain
- Assembly
- Savvyio.Extensions.DependencyInjection.EFCore.Domain.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddEfCoreAggregateDataSource(IServiceCollection, Action<EfCoreDataSourceOptions>, Action<ServiceOptions>)
Adds an EfCoreDataSource implementation to the specified IServiceCollection.
public static IServiceCollection AddEfCoreAggregateDataSource(this IServiceCollection services, Action<EfCoreDataSourceOptions> dataSourceSetup, Action<ServiceOptions> serviceSetup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
dataSourceSetupAction<EfCoreDataSourceOptions>The EfCoreDataSourceOptions which need to be configured.
serviceSetupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Remarks
The EfCoreAggregateDataSource will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
AddEfCoreAggregateDataSource<TMarker>(IServiceCollection, Action<EfCoreDataSourceOptions<TMarker>>, Action<ServiceOptions>)
Adds an EfCoreDataSource<TMarker> implementation to the specified IServiceCollection.
public static IServiceCollection AddEfCoreAggregateDataSource<TMarker>(this IServiceCollection services, Action<EfCoreDataSourceOptions<TMarker>> dataSourceSetup, Action<ServiceOptions> serviceSetup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
dataSourceSetupAction<EfCoreDataSourceOptions<TMarker>>The EfCoreDataSourceOptions which need to be configured.
serviceSetupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TMarker
Remarks
The EfCoreAggregateDataSource<TMarker> will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
AddEfCoreAggregateRepository<TEntity, TKey>(IServiceCollection, Action<ServiceOptions>)
Adds an EfCoreAggregateRepository<TEntity, TKey> to the specified IServiceCollection.
public static IServiceCollection AddEfCoreAggregateRepository<TEntity, TKey>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TEntity : class, IAggregateRoot<IDomainEvent, TKey>
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TEntityThe type of the entity.
TKeyThe type of the key that uniquely identifies the entity.
Remarks
The EfCoreAggregateRepository<TEntity, TKey, TMarker> will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
- See Also
-
EfCoreAggregateRepository<TEntity, TKey>
AddEfCoreAggregateRepository<TEntity, TKey, TMarker>(IServiceCollection, Action<ServiceOptions>)
Adds an EfCoreAggregateRepository<TEntity, TKey, TMarker> to the specified IServiceCollection.
public static IServiceCollection AddEfCoreAggregateRepository<TEntity, TKey, TMarker>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TEntity : class, IAggregateRoot<IDomainEvent, TKey>
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TEntityThe type of the entity.
TKeyThe type of the key that uniquely identifies the entity.
TMarkerThe type used to mark the implementation that this repository represents. Optimized for Microsoft Dependency Injection.
Remarks
The EfCoreAggregateRepository<TEntity, TKey, TMarker> will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
- See Also
-
EfCoreAggregateRepository<TEntity, TKey, TMarker>