I am trying to use the mvc-mini-profiler with MVC3 and keep getting the following error
Unable to determine the provider name for connection of type 'MvcMiniProfiler.Data.ProfiledDbConnection'
Below is the code that I am using to try and instatiate my Context.
DbConnection conn = new MySqlConnection(
ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString);
var profiledConnection = MvcMiniProfiler.Data.ProfiledDbConnection.Get(conn);
return new DB(profiledConnection);
And here is the DB Context Class.
public class DB:DbContext, Stats.Data.IDB
{
public DB(DbConnection conn)
: base(conn, true)
{
}...
No it is not a must. You can implement your database layer. But the thing you need is define Models for MVC: public class MyClass { [Display(Name = "SomeName")] [Required(ErrorMessage = "required")] public int?
MiniProfiler is an open source profiling library which monitors the performance of a . NET application. It is very lightweight and fast. Using this, we can easily track a performance issue with our application. It was created by Stack Overflow Team member.
Right-click the Controllers folder in Solution Explorer, select Add, and then click New Scaffolded Item. In the Add Scaffold dialog box, select MVC 5 Controller with views, using Entity Framework, and then choose Add.
Entity framework is an ORM (Object Relational Mapping) tool. Object Relational Mapping (ORM) is a technique of accessing a relational database; . i.e., whatever has tables and store procedure these things we interact with database in class, method and property of the object format.
As of version 1.5 this is now supported see: http://code.google.com/p/mvc-mini-profiler
The step to configure it are listed here: Using mvc-mini-profiler database profiling with Entity Framework Code First
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With