Dapper.net - Quick Start

Preview:

Citation preview

dapper.net – Quick start

What is dapper.net?

• Simple SQL object mapper for ADO.NET

• Open source - Apache License 2.0 -https://github.com/StackExchange/dapper-dot-net

• From Stack Exchange Team – dapper in production use @StackOverflow

How it works?

• Extension methods on top of IDbConnection interface.

• You require an instance of IDbConnection implementation, it works with any DB provider - Sqlite, Sqlce, firebird, oracle, MySQL, PostgreSQL and SQL Server

How can I get it?

• Download and build from GitHub -https://github.com/StackExchange/dapper-dot-net

• Copy the single SqlMapper.cs file from GitHub and include it in your project.

• Via NuGet – Install-Package Dapper

Why dapper?

Performance of SELECT mapping over 500 iterations - POCO serialization – Source github

Method Duration

Hand coded (using a SqlDataReader) 47ms

Dapper ExecuteMapperQuery 49ms

ServiceStack.OrmLite(QueryById) 50ms

PetaPoco 52ms

BLToolkit 80ms

SubSonic CodingHorror 107ms

NHibernate SQL 104ms

Linq 2 SQL ExecuteQuery 181ms

Entity framework ExecuteStoreQuery 631ms

Demo

Questions?

• Further reading – Kill your ORM

Thank you

Recommended