Table of Contents

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

services IServiceCollection

The IServiceCollection to add the service to.

setup Action<ServiceOptions>

The ServiceOptions which may be configured.

Returns

IServiceCollection

A reference to services so that additional calls can be chained.

Type Parameters

TService

The type of the IPersistentDataStore<T, TOptions> to add.

T

The 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
IPersistentDataStore<T, TOptions, TMarker>
IWritableDataStore<T, TMarker>
IReadableDataStore<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

services IServiceCollection

The IServiceCollection to add the service to.

setup Action<ServiceOptions>

The ServiceOptions which may be configured.

Returns

IServiceCollection

A reference to services so that additional calls can be chained.

Type Parameters

TService

The type of the IPersistentDataStore<T, TOptions> to add.

T

The type of the DTO to use.

TOptions

The 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
IPersistentDataStore<T, TOptions, TMarker>
IWritableDataStore<T, TMarker>
IReadableDataStore<T, TMarker>