AddUnitOfWork Method
Definition
- Namespace
- Savvyio.Extensions.DependencyInjection.Domain
- Assemblies
- Savvyio.Extensions.DependencyInjection.dll
AddUnitOfWork<TService>(IServiceCollection, Action<ServiceOptions>)
Adds an implementation of IUnitOfWork to the specified IServiceCollection.
public static IServiceCollection AddUnitOfWork<TService>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IUnitOfWork
Parameters
servicesIServiceCollectionThe IServiceCollection to add the service to.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional configuration calls can be chained.
Type Parameters
TServiceThe type of the IUnitOfWork 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.
- See Also
-
IDependencyInjectionMarker<TMarker>IUnitOfWork<TMarker>