Class RepositoryConfiguration<TDbContext, TUnitOfWorkService>
Inheritance
System.Object
RepositoryConfiguration<TDbContext, TUnitOfWorkService>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: WaCore.Data.Ef.DependencyInjection
Assembly: WaCore.Data.Ef.dll
Syntax
public class RepositoryConfiguration<TDbContext, TUnitOfWorkService>
where TUnitOfWorkService : IWacUnitOfWork
Type Parameters
Name | Description |
---|---|
TDbContext | |
TUnitOfWorkService |
Constructors
| Improve this Doc View SourceRepositoryConfiguration(IServiceCollection)
Declaration
public RepositoryConfiguration(IServiceCollection serviceCollection)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | serviceCollection |
Methods
| Improve this Doc View SourceAddRepositoriesFromAssemblyOf<TAssemblySelector>()
Adds repositories from assembly which defines the specified type.
A type is added if the name ends with 'Repisotory' and if it implements an interface with a matching name and the 'I' prefix. E.g. class BooksRepository: IBooksRepository
.
Declaration
public RepositoryConfiguration<TDbContext, TUnitOfWorkService> AddRepositoriesFromAssemblyOf<TAssemblySelector>()
Returns
Type | Description |
---|---|
RepositoryConfiguration<TDbContext, TUnitOfWorkService> |
Type Parameters
Name | Description |
---|---|
TAssemblySelector | A type defined in the assembly to scan |
AddRepository<TService, TImplementation>()
Registers a repository class and its implemented interface so it can be created by the UnitOfWork
Declaration
public RepositoryConfiguration<TDbContext, TUnitOfWorkService> AddRepository<TService, TImplementation>()where TService : class where TImplementation : TService
Returns
Type | Description |
---|---|
RepositoryConfiguration<TDbContext, TUnitOfWorkService> |
Type Parameters
Name | Description |
---|---|
TService | Interface implemented by the repository |
TImplementation | Repository concrete type. It must have a public constructor which takes the DbContext as argument. |