Table of Contents

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

services IServiceCollection

The IServiceCollection to extend.

dataSourceSetup Action<DapperDataSourceOptions>

The DapperDataSourceOptions that needs to be configured.

serviceSetup Action<ServiceOptions>

The ServiceOptions which may be configured.

Returns

IServiceCollection

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

Remarks

The implementation will be type forwarded accordingly.

Exceptions

ArgumentNullException

services cannot 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

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 configuration calls can be chained.

Type Parameters

TService

The 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

services cannot be null.

See Also

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

services IServiceCollection

The IServiceCollection to extend.

dataSourceSetup Action<DapperDataSourceOptions<TMarker>>

The DapperDataSourceOptions<TMarker> that needs to be configured.

serviceSetup Action<ServiceOptions>

The ServiceOptions which may be configured.

Returns

IServiceCollection

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

Type Parameters

TMarker

Remarks

The implementation will be type forwarded accordingly.

Exceptions

ArgumentNullException

services cannot 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

services IServiceCollection

The IServiceCollection to add the service to.

Returns

IServiceCollection

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

Type Parameters

TService

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

T

The type of the DTO to use.

Exceptions

ArgumentNullException

services cannot be null.