Dapper is an object mapper for .Net. As per stackoverflow definition, dapper is a micro-ORM, offering core parameterization and materialization services, but (by design) not the full breadth of services that you might expect in a full ORM such as LINQ-to-SQL or Entity Framework.
While working on one of project in my company, I have come across this library and found that it is one of the fastest ORM available in .net. For statistics, below is the result of select mapping over 500 iterations using different methods.
|Hand coded (using a SqlDataReader)||47ms|
|Linq 2 SQL ExecuteQuery||181ms|
|Entity framework ExecuteStoreQuery||631ms|
You can check more performance results of dapper at this guthub link.
Let’s create sample CRUD operation project with dapper as an ORM using ASP.NET MVC 4 and Sql server.
You can add dapper library to your project by downloading it from google code, or by using NuGet packages as shown in below image.
I have created class named person as shown below.
Also created database as shown below.
Below are the basic CRUD operations mapping with dapper.
Hope, this article is helpful to you for getting started with dapper.