Code: Select all
[TestMethod]
public void DbContext_With_DbConnection_EnsureDeleted()
{
// Works fine with .UseOracle(ConnectionString)
using (var dbContext = new TestDbContext(ConnectionString))
{
dbContext.Database.EnsureDeleted();
}
// Fails with .UseOracle(DbConnection)
using (var dbConnection = new OracleConnection { ConnectionString = ConnectionString })
{
using (var dbContext = new TestDbContext(dbConnection))
{
dbContext.Database.EnsureDeleted();
}
}
}
If this doesn't help, please upload a simple test project to some file exchange server.