When comparing Dapper vs Entity Framework, the Slant community recommends Dapper for most people. In the question“What are the best ORMs for C#?” Dapper is ranked 2nd while Entity Framework is ranked 3rd.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Very efficient and quick
Pro No need to roll your own conversion layer for the DataReader
Pro Similar performance to a raw SqlCommand with DataReader and parsing
Pro Makes it trivially easy to turn results into objects
Pro Makes it trivially easy to execute queries (scalar, multi-rows, multi-grids, and no-results)
Pro Makes it trivially easy to correctly parameterize queries
Pro Migrations API
List all versions of a schema, apply one or go back to a previous version.
Pro Database support
Supports most popular databases.
Pro Documentation
Better than the chaotic and confusing NHibernate documentation.
Pro Typesafe queries
Linq2Sql allows writing queries using the actual ORM types. This prevents issues when modifying the schema/entities.
Pro Avoids creation of inline SQL queries
No longer do you have to create/close SQL connections every time you want to interact with the database. You also don't have to maintain a database reader to handle the results retrieved from the database; all of this functionality is easily handled through LINQ queries and Entity Framework.
Pro Database agnostic
You can quite easily migrate from using one DB technology to another.
Pro Non intrusive object model
Object model is non-intrusive and consistent.
Cons
Con Not even slightly typesafe
If you make a typo in the SQL your CI server is not going to catch it, you'll have to hope it's caught during automated UI or functional testing.
Con A pain to maintain
You've got a bunch of inline SQL statements that do various queries that have no strong ties to the DB architecture. This can quite easily lead to queries that get "left behind" when the underlying DB structure changes, which, again, you will not see at build time.
Con It doesn't generate a class model or queries for you
Con It doesn't track objects and their changes so you can just call SubmitChanges()
Con Complicated
For simple data storage scenarios, EF may be unnecessarily complicated to learn.
Con Performance
Micro-ORMs have better performance.
Alternative Products
