ASP.NET Core / General
I like to call it as comparing of an auto-generated SQL to the one written by a good developer.
In Dapper it is simply
using (IDbConnection db = new SqlConnection(@"YourConnectionString")){return db.Query($"select top 5000 * from users").ToList();}
In EF Core, we can do in either ways. From SQL or letting the library generate the query.
using (var db = new EFCore2TestContext()){return db.Users.FromSql("Select top 5000 * from users").AsNoTracking().ToList();//return db.Users.Take(5000).AsNoTracking().ToList();}
Looking in to the results, we can say Dapper is faster than the Entity Frame Core 2. And it is a matter of peoples' interest. If performance is your biggest concern, Use dapper. And if the concern is in saving development time, use entity framework instead with compromising a little bit on performance.
courtesy : https://medium.com/@engr.mmohsin/entity-framework-core-2-dapper-performance-benchmark-c29e8cce9e1b