Tuesday 8 May 2018

Micro-ORM Dapper Short Info

See what Microsoft says about Dapper in his official website.

Dapper is a micro-ORM built and maintained by StackExchange engineers. It focuses on performance, and can map the results of a query to a strongly-typed list, or to dynamic objects.

Dapper is in production use at Stack Overflow.

Supports

Dapper works with almost all popular provider of across all

  • .NET ADO providers
  • SQLite
  • SQL CE
  • Firebird
  • Oracle
  • MySQL
  • PostgreSQL and
  • SQL Server.

Advantages


  • Efficiently work with raw execution with minimal overheads.
  • Retain control over SQL server syntax.
  • Light wight ORM

Limitations

Implementation of Dapper use ConcurrentDictionary in order to maintain cache item for better performance of query execution.And the cached item never flushed. So if we use parameterised query than its good or else for the raw sql script execution it may hit memory.

My favorite
  • Multiple Results, Single execution with multiple query.
  • Multi Mapping, Work with Join.
  • Return list of dynamic objects, <dynamic>.
  • Support async call.
For examples have a look on StackExchange .