Show / Hide Table of Contents

Interface IDbContextFactory<TDbContext>

Namespace: Accelergreat.EntityFramework
Assembly: Accelergreat.EntityFramework.dll
Syntax
public interface IDbContextFactory<out TDbContext> : IDbContextFactoryEvents<TDbContext> where TDbContext : DbContext
Type Parameters
Name Description
TDbContext

Methods

ChangeContextType<TDbContext2>()

Declaration
IDbContextFactory<TDbContext2> ChangeContextType<TDbContext2>()
    where TDbContext2 : DbContext
Returns
Type Description
IDbContextFactory<TDbContext2>
Type Parameters
Name Description
TDbContext2

NewDbContext()

Creates a new TDbContext.

The caller is responsible for disposing the context.

Declaration
TDbContext NewDbContext()
Returns
Type Description
TDbContext

NewDbContext(Boolean)

Creates a new TDbContext.

The caller is responsible for disposing the context.

Declaration
TDbContext NewDbContext(bool useTransactionOverriding)
Parameters
Type Name Description
System.Boolean useTransactionOverriding

Will only be used if the reset strategy is set to transactions in the accelergreat.json configuration file.

If set to true, Accelergreat will intercept Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.BeginTransaction by returning the transaction that is used with the test database. Commits and Rollbacks will be translated to use savepoints. By default, useTransactionOverriding is set to false.

Returns
Type Description
TDbContext
In This Article
Back to top Copyright © Nanogunn Ltd.