public EFRepo(DbContext ctx)
{
this.DbContext = ctx;
this.DbConnection = ((ctx as System.Data.Entity.Infrastructure.IObjectContextAdapter).ObjectContext.Connection
as EntityConnection).StoreConnection;
this.DbSet = ctx.Set<TEntity>();
}
In the above code
(ctx as System.Data.Entity.Infrastructure.IObjectContextAdapter).ObjectContext.Connection
as EntityConnection
is getting null when i am changing EF 4 to 4.5