Class ServiceCollectionExtensions
- Namespace
- Savvyio.Extensions.DependencyInjection.Dapper
- Assembly
- Savvyio.Extensions.DependencyInjection.Dapper.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddDapperDataSource(IServiceCollection, Action<DapperDataSourceOptions>, Action<ServiceOptions>)
Adds an DapperDataSource implementation to the specified IServiceCollection.
public static IServiceCollection AddDapperDataSource(this IServiceCollection services, Action<DapperDataSourceOptions> dataSourceSetup, Action<ServiceOptions> serviceSetup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
dataSourceSetupAction<DapperDataSourceOptions>The DapperDataSourceOptions that needs 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 implementation will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
AddDapperDataSource<TService>(IServiceCollection, Action<ServiceOptions>)
Adds an implementation of IDapperDataSource to the specified IServiceCollection.
public static IServiceCollection AddDapperDataSource<TService>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IDapperDataSource
Parameters
servicesIServiceCollectionThe IServiceCollection to add the service to.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional configuration calls can be chained.
Type Parameters
TServiceThe type of the IDapperDataSource interface to add.
Remarks
If the underlying type of TService implements IDependencyInjectionMarker<TMarker> interface then this is automatically handled. Also, the implementation will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
- See Also
-
IDependencyInjectionMarker<TMarker>IDapperDataSource<TMarker>
AddDapperDataSource<TMarker>(IServiceCollection, Action<DapperDataSourceOptions<TMarker>>, Action<ServiceOptions>)
Adds an DapperDataSource<TMarker> implementation to the specified IServiceCollection.
public static IServiceCollection AddDapperDataSource<TMarker>(this IServiceCollection services, Action<DapperDataSourceOptions<TMarker>> dataSourceSetup, Action<ServiceOptions> serviceSetup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
dataSourceSetupAction<DapperDataSourceOptions<TMarker>>The DapperDataSourceOptions<TMarker> that needs 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 implementation will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
AddDapperDataStore<TService, T>(IServiceCollection)
Adds an implementation of DapperDataStore<T, TOptions> to the specified IServiceCollection.
public static IServiceCollection AddDapperDataStore<TService, T>(this IServiceCollection services) where TService : DapperDataStore<T, DapperQueryOptions> where T : class
Parameters
servicesIServiceCollectionThe IServiceCollection to add the service to.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TServiceThe type of the DapperDataStore<T, TOptions> abstraction to add.
TThe type of the DTO to use.
Exceptions
- ArgumentNullException
servicescannot be null.