protected ConsentContext CreateNewContextInSameTransaction() { var newContext = fixture.GetContext(outputHelper, Context.Database.GetDbConnection()); newContext.Database.UseTransaction(transaction.GetDbTransaction()); return(newContext); }
protected DbTests(ITestOutputHelper outputHelper, DatabaseFixture fixture) { this.outputHelper = outputHelper; this.fixture = fixture; Context = fixture.GetContext(outputHelper); transaction = Context.Database.BeginTransaction(); createContext = CreateNewContextInSameTransaction(); updateContext = CreateNewContextInSameTransaction(); readContext = CreateNewContextInSameTransaction(); }