To reuse open connections, I'm attempting to follow patterns seen in answers such as:
- DbContext won't keep connection open for re-use
- Many queries and too much opening / closing of the same connection
These examples use System.Data.EntityClient.EntityConnection
which I'm unable to locate a reference using Entity Framework Core.
using (var conn = new EntityConnection(connectionString))
{
conn.Open();
using (var db = new MyContext(conn))
{
...
db.SaveChanges()
}
}
Is EntityConnection
not available in EF Core, or is there a package I need to reference beyond the Entity Framework Core packages?