Dapper is a lightweight ORM class. The code is a SqlMapper.cs file, mainly the IDbConnection extension method, compiled on a very small dll of 118K. Official site http://code.google.com/p/dapper-dot-net/
MVC Miniprofiler is a small program designed by the stack Overflow team for performance analysis of ASP. You can monitor a page itself, as well as other pages accessed through direct references, Ajax, and IFRAME, to monitor content including database content, and to display SQL for database access (EF, EF codefirst, etc.). and displayed on the page in a friendly way.
A particularly useful feature of the profiler is its integration with the database framework. Apart from. NET native DbConnection class, Profiler also has built-in support for the Entity Framework and LINQ to SQL. Any step that executes will include the number of queries and the time spent. To detect common errors, such as the n+1 anti-pattern, Profiler detects multiple queries with only a difference in parameter values.
Miniprofiler is released under the Apache License V2.0 protocol, which you can find in NuGet. Configuration and usage can be seen here: Http://code.google.com/p/mvc-mini-profiler (MVC miniprofiler description from Zhang Shanyu article http://www.cnblogs.com/shanyou/ archive/2012/04/03/2430977.html)
The above two open source projects are used on StackOverflow. Of course we can also use MVC Miniprofiler to monitor the SQL execution time in dapper, as follows:
PublicStaticList<contact> Getcontacts (stringsqlConnectionString)
{
//list<contact> userlist = new list<contact> ();
varconn =NewProfileddbconnection (NewSqlConnection (sqlconnectionstring), miniprofiler.current);
Conn. Open ();
varresult = Conn. Query<contact> ("SELECT * FROM dbo. Contact where id> @id",New{id =0});
returnResult. ToList ();
To view the execution time of SQL in page dapper:
Dapper with MVC Miniprofiler