Closed GoogleCodeExporter closed 8 years ago
This is by-design, I removed Get ... instead use the constructor
Having it in a static meant you could not properly inherit off profiled
connection which in turn meant we could not pull out the EF code to its own
assembly
Original comment by sam.saff...@gmail.com
on 15 Sep 2011 at 1:38
Can you give us the code for using it by constructor? The documentation hasn't
been updated on this project
Original comment by notda...@gmail.com
on 22 Sep 2011 at 5:09
this is what I used
private MyEntities CreateDBContext()
{
var dbConnection = GetConnection();
if (_enableProfiling)
{
dbConnection = new EFProfiledDbConnection(dbConnection, MiniProfiler.Current);
}
return dbConnection.CreateObjectContext<MyEntities>();
}
private DbConnection GetConnection()
{
var connectionString = new EntityConnectionStringBuilder(ConfigurationManager.ConnectionStrings["MyEntities"].ConnectionString);
DbConnection dbConnection = new SqlConnection(connectionString.ProviderConnectionString);
return dbConnection;
}
Original comment by Eric.R.H...@gmail.com
on 22 Sep 2011 at 5:12
Where do you define EFProfiledDbConnection?
Original comment by notda...@gmail.com
on 22 Sep 2011 at 5:19
Should be part of the MvcMiniProfiler.Data namespace. Make sure you are
running the latest dll since there was a major update and they didn't update
the documentation.
Original comment by Eric.R.H...@gmail.com
on 22 Sep 2011 at 5:25
EFProfiledDbConnection is in MiniProfiler.EF
Original comment by sam.saff...@gmail.com
on 23 Sep 2011 at 10:55
Original issue reported on code.google.com by
Eric.R.H...@gmail.com
on 14 Sep 2011 at 4:51