Table of Contents

AddDataSource Method

Definition

Namespace
Savvyio.Extensions.DependencyInjection
Assemblies
Savvyio.Extensions.DependencyInjection.dll
Source
src/Savvyio.Extensions.DependencyInjection/ServiceCollectionExtensions.cs

AddDataSource<TService>(IServiceCollection, Action<ServiceOptions>)

Adds an implementation of IDataSource to the specified IServiceCollection.

public static IServiceCollection AddDataSource<TService>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IDataSource

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 IDataSource 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
IDataSource<TMarker>