【. Net-ef "Entity Framework learning Note 4: Pros and cons

Source: Internet
Author: User
Tags live chat

EF, simply say the database of the table generated entity class, each result is an entity class set (type such as ilist<>,iqueryable<>), add and Delete change method encapsulated , direct operation, Save the Go Database tool write statements.

EF5.0 After the delay of execution, in fact, is iqueryable<> and SaveChange (), meaning you can divide the sentence into a few paragraphs, and finally only once generated.

EF is the ORM Framework (object-relational mapping), in the previous program, I often go to the database of the table generated entity classes, convenient development, the framework is more convenient, packaged and deleted and modified.

Based on ADO, will automatically generate SQL statements, depending on the database, with LINQ to write statements will be more convenient, but simple and relatively good, complex statements will often be compared (this is actually more tired)

Advantages:

Programs can use different databases, because EF generates statements based on different databases;

Can not go to the database tool (API) to write statements;.

All by the entity class to execute, no longer go to the database to find fields;

Disadvantages:

Highly concurrent programs (such as live chat) are not recommended;

Write LINQ complex point query Statements (tables, multiple subqueries, conditional mates) is very painful, and to use the tool to see whether the generated statements are logical, and can not be constantly debugging (I think the function is debugging out, the brain hole big open people can skip);

EF Replacement version is really a pit, if you want to upgrade the program's EF from the lower version to the higher version, the higher version will be less than many methods (see the data is clearly written sqlquerybydynamic ()), now know that the biggest change is 5.0

【. Net-ef "Entity Framework learning Note 4: Pros and cons

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.