private void DeleteTableIfExists(params string[] tableNames) { using (var sc = new ScopedConnection()) { foreach (var tableName in tableNames) { if (sc.Processor.TableExists(null, tableName)) { sc.Processor.Execute(string.Format("DROP TABLE \"{0}\"", tableName)); } } } }
protected virtual void EnsureTransaction(DbContext dbContext) { Logger.Debug("EnsureTransaction"); if (ScopedConnection.CurrentTransaction.Value == null) { ScopedConnection.BeginTransaction(dbContext.Database); } else { var currentTransaction = ScopedConnection.CurrentTransaction.Value; Logger.Debug("UseTransaction " + currentTransaction.TransactionId); dbContext.Database.UseTransaction(currentTransaction.GetDbTransaction()); } }
public void Dispose() { Logger.Debug("Disposing TestServerFixture"); ScopedConnection.Rollback(); Client.Dispose(); }