Class ServiceCollectionExtensions
- Namespace
- Savvyio.Extensions.DependencyInjection.Data
- Assembly
- Savvyio.Extensions.DependencyInjection.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddDataStore<TService, T>(IServiceCollection, Action<ServiceOptions>)
Adds an implementation of IPersistentDataStore<T, TOptions> to the specified IServiceCollection.
public static IServiceCollection AddDataStore<TService, T>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IPersistentDataStore<T, AsyncOptions> where T : class
Parameters
servicesIServiceCollectionThe IServiceCollection to add the service to.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TServiceThe type of the IPersistentDataStore<T, TOptions> to add.
TThe type of the DTO to use.
Remarks
If the underlying type of TService implements IDependencyInjectionMarker<TMarker> interface then this is automatically handled. Also, the implementation will be type forwarded accordingly.
- See Also
-
IDependencyInjectionMarker<TMarker>IPersistentDataStore<T, TOptions>IPersistentDataStore<T, TOptions, TMarker>IWritableDataStore<T, TMarker>IReadableDataStore<T, TMarker>IDeletableDataStore<T, TMarker>
AddDataStore<TService, T, TOptions>(IServiceCollection, Action<ServiceOptions>)
Adds an implementation of IPersistentDataStore<T, TOptions> to the specified IServiceCollection.
public static IServiceCollection AddDataStore<TService, T, TOptions>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IPersistentDataStore<T, TOptions> where T : class where TOptions : AsyncOptions, new()
Parameters
servicesIServiceCollectionThe IServiceCollection to add the service to.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TServiceThe type of the IPersistentDataStore<T, TOptions> to add.
TThe type of the DTO to use.
TOptionsThe type of the options associated with
T.
Remarks
If the underlying type of TService implements IDependencyInjectionMarker<TMarker> interface then this is automatically handled. Also, the implementation will be type forwarded accordingly.
- See Also
-
IDependencyInjectionMarker<TMarker>IPersistentDataStore<T, TOptions>IPersistentDataStore<T, TOptions, TMarker>IWritableDataStore<T, TMarker>IReadableDataStore<T, TMarker>IDeletableDataStore<T, TMarker>