Entity Framework Core vs Dapper

Both get data from a database into C# objects. EF Core does more for you; Dapper gets out of your way.

Which should you choose?

Entity Framework Core

Choose it if you want migrations, change tracking and LINQ, and most of your queries are ordinary CRUD.

Dapper

Choose it if you want to write and control every SQL query yourself, or you need the lowest overhead on a hot path.

Side by side

Entity Framework CoreDapper
PriceFreeFree
Level——
PlatformsNuGetNuGet
SetupAdd the provider package, define a DbContext, run migrationsAdd the package, write SQL
Best forThe default data layer for most .NET appsHand-written SQL without boilerplate
Strengths
  • Migrations built in
  • LINQ queries with change tracking
  • Fast, tiny API
  • Full control over SQL
Drawbacks
  • Generated SQL can surprise you; check it for hot paths
  • No migrations or change tracking
WebsiteVisit ↗Visit ↗

Prices change; figures are approximate and were last checked on the date shown on each tool's page.