Class DbContextResolver<TDbContext>
- Namespace
- JsonApiDotNetCore.Repositories
- Assembly
- JsonApiDotNetCore.dll
Provides a method to resolve a DbContext.
[PublicAPI]
public sealed class DbContextResolver<TDbContext> : IDbContextResolver where TDbContext : DbContext
Type Parameters
TDbContextThe type of the DbContext to resolve.
- Inheritance
-
DbContextResolver<TDbContext>
- Implements
- Inherited Members
Constructors
DbContextResolver(TDbContext)
public DbContextResolver(TDbContext dbContext)
Parameters
dbContextTDbContext
DbContextResolver(TDbContext, IReferencingForeignKeysCache)
public DbContextResolver(TDbContext dbContext, IReferencingForeignKeysCache foreignKeysCache)
Parameters
dbContextTDbContextforeignKeysCacheIReferencingForeignKeysCache
Methods
GetContext()
public DbContext GetContext()
Returns
GetForeignKeysRequiringClientSetNullOnDelete(Type)
Returns the referencing foreign keys that have ClientSetNull for the specified principal entity type.
public IReadOnlyList<IReadOnlyForeignKey> GetForeignKeysRequiringClientSetNullOnDelete(Type entityClrType)
Parameters
entityClrTypeType
Returns
GetTypedContext()
public TDbContext GetTypedContext()
Returns
- TDbContext