tekguy
10/23/2014 - 3:19 PM

Get a SqlConnection from a DbContext

Get a SqlConnection from a DbContext

private SqlConnection GetSqlConnection(DbContext dbContext)
{
    var ec = dbContext.Database.Connection;
    var adoConnStr = ec.ConnectionString;
    return new SqlConnection(adoConnStr);
    
}