The creators of Dapper and the Entity Framework team discuss the strengths, weaknesses, and ideal use cases for both libraries.
Dapper maintainers and key contributors Nick and Marc will show people the glorious power of Dapper and everything it can do, so they are fully informed and can choose something much better, like EF Core (their words).
Community Links: theurlist.com/efcore-standup-2021-08-25
Featuring: Shay Rojansky (@shayrojansky), Nick Craver (@nick_craver), Marc Gravell (@marcgravell)
Get your questions answered on the Microsoft Q&A for .NET - aka.ms/dotnetqa
Learn .NET with free self-guided learning from Microsoft Learn: aka.ms/learndotnet
#orm #Dapper
Why it's here
2 people recommend this
What people say. Recommended for its insightful discussion on when to choose Entity Framework versus Dapper for database operations.
Moments people linked to
H
u/Havavegein r/dotnet • Recommends
On “Devs who use EF instead of Dapper: Why?”
The EF team just did a community video with the Dapper guys from Stack Overflow and they talked a bit about use cases.
link to this video
Complex nested objects: use EF because Dapper doesn't do them well.
On “Advice for the web API app development using clean architecture in .NET 6.”
Dapper is generally quite awful at managing bigger unit of works in a single transaction. You can do it, but It's a lot of overhead to manage all of that manually and ensure everything is commited in order. EF handles the order correctly with the change tracker.
There is a community talk with the creators if Dapper here, where they talk about scenarios where they would rather use EF.
>Why not just... not do that? Write a basic SQL query that maps on untracked POCOs with Dapper or disable tracking in EF?
You do that with EF also by writing a select into a DTO, there is no difference. You just write LINQ instead of raw SQL. You should only load and use entities for writes.