Table of Contents

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

TDbContext

The type of the DbContext to resolve.

Inheritance
DbContextResolver<TDbContext>
Implements
Inherited Members

Constructors

DbContextResolver(TDbContext)

public DbContextResolver(TDbContext dbContext)

Parameters

dbContext TDbContext

DbContextResolver(TDbContext, IReferencingForeignKeysCache)

public DbContextResolver(TDbContext dbContext, IReferencingForeignKeysCache foreignKeysCache)

Parameters

dbContext TDbContext
foreignKeysCache IReferencingForeignKeysCache

Methods

GetContext()

public DbContext GetContext()

Returns

DbContext

GetForeignKeysRequiringClientSetNullOnDelete(Type)

Returns the referencing foreign keys that have ClientSetNull for the specified principal entity type.

public IReadOnlyList<IReadOnlyForeignKey> GetForeignKeysRequiringClientSetNullOnDelete(Type entityClrType)

Parameters

entityClrType Type

Returns

IReadOnlyList<IReadOnlyForeignKey>

GetTypedContext()

public TDbContext GetTypedContext()

Returns

TDbContext