A simple, fast object mapper for .NET
open sourceApache-2.0free
Dapper is a micro-ORM for .NET: a set of extension methods on DbConnection that run the SQL you write and map the results to objects, synchronously or asynchronously, buffered or streamed. It was built for and by Stack Overflow and is known for speed close to hand-written ADO.NET. It maps one row to several objects (multi-mapping), reads multiple result sets from one command, and takes parameters as anonymous objects or a DynamicParameters builder for safe dynamic SQL. Companion packages add CRUD helpers (Dapper.Rainbow), composable query building (Dapper.SqlBuilder) and Entity Framework type handlers. It works with any ADO.NET provider, such as SQL Server, PostgreSQL, MySQL and SQLite.
Problems it solves
- map SQL query results to C# objects without the overhead of Entity Framework
- write my own SQL in .NET but stop hand-writing data reader loops
- a fast lightweight data access layer for SQL Server in an ASP.NET app
Features
- Extension methods on DbConnection for queries and commands
- Synchronous and asynchronous, buffered and unbuffered queries
- Multi-mapping one row to several objects
- Multiple result sets from one command
- Parameterized queries with anonymous objects or DynamicParameters
- Works with any ADO.NET provider
Alternatives
The same job
These do what Dapper does.
- Entity Framework Core A lightweight, extensible, open source and cross-platform version of Entity Framework
- FreeSql .NET ORM with CodeFirst, DbFirst and support for many databases, including AOT builds
- Entity Framework 6 A tried and tested object-relational mapper for .NET
- NHibernate The object-relational mapper for .NET
- SQLite-net A small SQLite client and ORM for .NET
