ORM Frameworks - Rades98/AlzaCaseStudy GitHub Wiki

Dapper is literally much faster than Entity Framework Core considering the fact that there are no bells and whistles in Dapper. It is a straight forward Micro ORM that has minimal features as well. It is always up to the developer to choose between these 2 Awesome Data Access Technologies. This does not mean that Entity Framework Core is any slower. With every update, the performance seems to be improving as well. Dapper is heaven for those who still like to work with RAW Queries rather than LINQ with EFCore.

Entity Framework core

Migrations

Advantages

  • Entity Framework allows you to create a model by writing code or using boxes and lines in the EF Designer and generate a new database.
  • You can write code against the Entity Framework, and the system will automatically produce objects for you as well as track changes on those objects and simplify the process of updating the database.
  • One common syntax (LINQ) for all object queries whether it is a database or not and pretty fast if used as intended, easy to implement and less coding required to accomplish complex tasks.
  • The EF can replace a large chunk of code you would otherwise have to write and maintain yourself.
  • It provides auto-generated code
  • It reduces development time and cost.
  • It enables developers to visually design models and mapping of database

Disadvantages

  • You have to think in a non-traditional way of handling data, not available for every database.
  • If there is any schema change in database FE won't work and you have to update the schema in solution as well.
  • The EF queries are generated by the provider that we cannot control.
  • It is not good for a huge domain model.
  • Lazy loading is the main drawbacks of EF

Dapper

Advantages

  • Dapper make it easy to correctly parameterize queries
  • It can easily execute queries (scalar, multi-rows, multi-grids, and no-results)
  • Make it easy to turn results into objects
  • It is very efficient and owns the title of King of Micro ORM in terms of performance.

Disadvantages

  • Dapper can't generate a class model for you
  • It cannot generate queries for you
  • It cannot track objects and their changes
  • The raw dapper library doesn't provide CRUD features, but the "contrib" additional package does provide basic CRUD.