Table of Contents

AddDapperDataSource Method

Definition

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<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.

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