The profiler is installed in my MVC 3 app and it works, but what I'm having a hard time with is the correct way to get the EF 4 db portion setup correctly.
from the home page of the profiler
Use a factory to return your connection:
public static DbConnection GetOpenConnection()
{
var cnn = CreateRealConnection();
// wrap the connection with a profiling connection that tracks timings
return MvcMiniProfiler.Data.ProfiledDbConnection.Get(cnn, MiniProfiler.Current);
}
Entity Framework
public static MyModel Get()
{
var conn = ProfiledDbConnection.Get(GetConnection());
return ObjectContextUtils.CreateObjectContext<MyModel>(conn);
}
Ok, so right off the bat I'd like clarification whether the call to GetConnection() of the MyModel Get method should read GetOpenConnection()?
Then if it is a typo, what would the CreateRealConnection look like? I am using ODP.NET via the provider model and my Model Library does not have a ref to Oracle.DataAccess.Client and I'd prefer to keep it that way if I can.
Also, where would all this code reside in my repository?
public IQueryable<PRODUCTHEADER> Products
{
get{ return ctx.PRODUCTHEADERs.AsQueryable(); }
}
Thank you, Stephen