Use of the Entity framework and dapper

Source: Internet
Author: User

EF is the Microsoft series to correct seedling Red's heavyweight orm framework, powerful, the operation of the database almost without writing SQL, you can write C # code like the operation of the database, especially in support of multi-table association operation is very convenient, but the resulting SQL statement performance is poor, it is not flattering. But the performance has improved after EF6.
Dapper is a very mainstream lightweight sports car ORM framework, because there is a large traffic in the foreign site StackOverflow, his database connection is supported by dapper, so in the. NET platform dapper get a high degree of attention, he is very simple and lightweight, Support for SQL statements is more powerful,
Programmers can write their own efficient SQL statements, handed over to Dapper to execute, dapper do more work just like the query result mapping process we want to the object model, very flexible. Operation of the database is fast, and he also supports some cross-table query operations.
EF uses three modes of code First,dbfirst and Contextfirst He can help us generate a data model or generate a data table from a data model. Dapper seems to have no such function.
So we need to consider in the technology selection when the team to go to the SQL is to use EF if not to the SQL team is to use dapper.
Sometimes it's more about combining EF with dapper, using EF to perform query operations, and write operations using dapper

Use of the Entity framework and dapper

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.