Dapper Overview


Dapper is an open-source, lightweight ORM developed by the Stack Overflow team. It is a simple object mapper for the Microsoft .NET platform.

  • It is a framework for mapping an object-oriented domain model to a traditional relational database.
  • It is free as open-source software distributed under a dual license, either the Apache License 2.0 or the MIT License.

What is ORM

ORM stands for Object-Relational Mapping (ORM) is a programming technique for converting data between relational databases and object-oriented programming languages such as Java, C#, etc.

Object-relational mappers (ORMs) have been in use for a long time to eliminate the impedance mismatch that exists between the object models of programming languages and the data models in relational databases.

Why Dapper?

Dapper is very lightweight, and because of its weight, it is very fast compared to other ORMs.

  • The performance and ease of use were the main reasons kept in mind during its development.
  • It provides support for both static and dynamic object binding using transactions, stored procedures, or bulk inserts of data.
  • It is not database specific, it works across all .NET ADO providers such as SQL Server, SQLite, Firebird, Oracle, MySQL, PostgreSQL.

Features

The following are the key features of Dapper.

  • High performance
  • Fewer lines of code
  • Object mapper
  • Choice of static/dynamic object binding
  • Easy handling of SQL query
  • Multiple query support
  • Support and easy handling of stored procedures
  • Operating directly on IDbConnection interface
  • Bulk data insert functionality