Table of Contents

AddAggregateRepository Method

Definition

AddAggregateRepository<TService, TEntity, TKey>(IServiceCollection, Action<ServiceOptions>)

Adds an implementation of IAggregateRepository<TEntity, TKey> to the specified IServiceCollection.

public static IServiceCollection AddAggregateRepository<TService, TEntity, TKey>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IAggregateRepository<TEntity, TKey> where TEntity : class, IAggregateRoot<IDomainEvent, TKey>

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 IAggregateRepository<TEntity, TKey> to add.

TEntity

The type of the entity.

TKey

The type of the key that uniquely identifies the entity.

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
IAggregateRepository<TEntity, TKey>
IAggregateRepository<TEntity, TKey, TMarker>
IPersistentRepository<TEntity, TKey>
IPersistentRepository<TEntity, TKey, TMarker>