DEV Community

Discussion on: Using Dapper over EntityFramework for database operations in .NET Core

Collapse
 
shaijut profile image
Shaiju T

Nice 😄, Dapper x2 times faster than EF Core doesn't seems good for me because if you are concerned about performance, then you can do it in DB level with raw performance of ADO.NET code.

Also I think writing SQL query like select * from inside C# code is not maintainable. But EF Core looks pretty clean. I have not used Dapper ? What you think ?

Collapse
 
lonehawk77 profile image
Claudio Valerio

IMO it really depends on the type of application you're writing, the statistical distribution between read and write operations and other factors, like the production environment, etc.
Both dapper and ef are just tools, to be chosen thinking at the big picture.

For most applications I generally agree with your point of view, ef readability and maintainability worth the cost in performances, especially if you put a sane layer of caching in front of your read ops.

There are other situations (low mem devices, simpler database structure and interaction, still want/need to use a RDBMS as persistence layer...) where Dapper represent a good alternative to raw ado.net.