dapper is the micro-ORM for .NET developed and used by the stackoverflow team, focusing on raw performance as the primary aim.

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. Instead, it focuses on making the materialization as fast as possible, with no overheads from things like identity managers - just "run this query and give me the (typed) data".

However, it retains support for materializing non-trivial data structures, with both horizontal (joined data in a single grid) and vertical (multiple grids) processing.

Quite possibly the fastest materializer available for .NET, and available here: code.google.com/p/dapper-dot-net/

Getting Started with Dapper

Dapper comprises of a single file, it lives on Google code: SqlMapper.cs. You can either include the file, as is, in your project. Or install it via nuget.

Here is a video with a simple example.

A simple Hello World sample

using Dapper;
using (var connection = new SqlConnection(myConnectionString))
  var posts = connection.Query<Post>("select * from Posts");

  //... do stuff with posts

CRUD operation

Dapper provides a minimal interface between your database and your application. Even though the interface is minimal it still supports the full array of database operations. Create, Read, Update, Delete are fully supported. Using stored procedures or not.

See also:

The Multi Mapper

Dapper allows you to automatically split a single row to multiple objects. This comes in handy when you need to join tables.

See also:


A key feature of Dapper is performance. You can go through the performance of SELECT mapping over 500 iterations at this link.

.NET Framework support

Dapper runs best on .NET 4.0 or later. It makes use of Dynamic features in the language and optional params. You can run Dapper on .NET 3.5 as well. There are no known ports that avoid dynamic method generation. There are no known ports to .NET 2.0.

Dapper also works fine in Mono

Nuget package

Dapper can most easily be installed through its NuGet package.

Install-Package Dapper


The Dapper solution includes the following extensions:

  • Dapper.Rainbow
  • Dapper.Contrib
  • Dapper.SqlBuilder