Entity Framework (EF) 5

Source: Internet
Author: User

Entity Framework (EF) 5 was officially released shortly after Entity Framework was announced to be open-source. EF5 released on the ADO. Net official blog lists the new features of EF5:

    • Supported enumeration types
    • Performance Enhancement, especially in. Net 4.5
    • Automatic use of localdb and sqlserverexpress
    • Spatial types
    • Table Valued Functions
    • Stored Procedure with multiple result sets

Compatibility supports. Net 2010 and 2012 application projects on Visual Studio 4.0 and Visual Studio 4.5.

Microsoft has published a white paper that outlines various performance considerations when using Entity Framework 5 (which is released as part of. Net 4.5.

Note the following:

    • Cold query execution. warm query execution (cold-vs-warm query execution) -- view generation (required for conversion from database mode to conceptual mode or from conceptual mode to data mode) it will increase the overhead for the first query, and the later running will be faster because of the View cache. You can use a pre-generated view to improve performance;
    • Cache-at the object level (especially when autodetectchanges is disabled to improve dbcontext find () performance), available caches include query plan caching and metadata caching) and result cache (results caching ). EF still does not provide secondary cache, but we can refer to some guidelines for implementation-such as examples on codeplex and Julia Lerman'sArticle"Entity Framework and level 2 cache in Windows azure ";
    • Optional no trace query (no State tracing overhead ). Currently, this option is only available for objectquery and cannot be applied to dbset and dbquery classes;
    • Quick query in the micro-ORM style, such as SQL query executed on the database and executestorequery;
    • Considerations during design-each layer corresponds to a table (table-per-hierarchy, TPH). each type corresponds to a table (table-per-type, TPT for short). each class corresponds to a table (table-per-class, TPC for short), where TPT performs the worst in query complexity and performance;
    • Delayed loading vs. pre-loading (lazy-vs-eager loading ).

Entity Framework is a. NET application provided by Microsoft.ProgramBusiness Object relationship ing framework. In addition to EF,. NET developers can also choose some (open-source and commercial) products including Nhibernate and lightspeed. In addition, there are some lightweight micro-ORM models such as dapper. net, petapoco, and massive.

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.