Class ExplicitUnitOfWorkServiceCollections
- Namespace
- KYS.EFCore.Library.Extensions
- Assembly
- KYS.EFCore.Library.dll
Provides extension methods for registering IUnitOfWork in an IServiceCollection.
public static class ExplicitUnitOfWorkServiceCollections
- Inheritance
-
ExplicitUnitOfWorkServiceCollections
- Inherited Members
Methods
AddExplicitUnitOfWork<TDbContext>(IServiceCollection)
Registers IUnitOfWork as a scoped service implemented by DbContextUnitOfWork<TDbContext>,
sharing the TDbContext instance of the same scope.
public static IServiceCollection AddExplicitUnitOfWork<TDbContext>(this IServiceCollection services) where TDbContext : DbContext
Parameters
servicesIServiceCollectionThe IServiceCollection instance this method extends.
Returns
- IServiceCollection
The same IServiceCollection instance, so that calls can be chained.
Type Parameters
TDbContextThe type of DbContext. It must be registered separately (e.g. with
AddDbContext).