Introduction to Entity Framework

Source: Internet
Author: User

Introduction to Entity Framework

Referred to as EF, and the relationship with ADO
The ADO. NET Entity Framework is an object relationship correspondence (O/R Mapping) solution developed by Microsoft based on ADO, which was earlier known as ObjectSpace and is now included in Visual Studio Servi CE Pack 1 and. NET Framework 3.5 Service Pack 1 are published.
The Entity Framework is a set of technologies in ADO that support the development of data-oriented software applications. is an ORM framework for Microsoft.

EF is very automated, good performance?
EF performance is also relatively high: EF is to help us generate SQL scripts, so at the SQL Server level, the basic is the same.
Performance loss: Mainly in the stage of generating SQL scripts, depending on the entity changes, and then based on the ORM mapping relationship in the EDMX generated SQL, almost the performance of the loss at the entire system level is negligible.
When some EF-generated SQL is not very good, you can use your own SQL, or execute stored procedures.

What is the O/R Mapping

In broad sense, ORM refers to the mutual transformation between object-oriented object model and relational database data structure.
In the narrow sense, ORM can be considered as a data storage based on relational database, which realizes a virtual object-oriented data access interface. Ideally, based on such an object-oriented interface, persisting an Oo object should not require understanding the implementation details of any relational database storage data.

ORM: All implementations of the ORM Framework, are implementing a unified portal, the developer through this unified portal to the table entity CRUD Operations, and then the ORM framework automatically helps us monitor the change of entity state, and then generate the corresponding SQL script according to the state of the entity, Then call the underlying ADO to execute into the database to affect the table changes.

ORM in EF

The Entity Data Model (EDM) in EF is defined by the following three models and a mapping file with the corresponding file name extension:

Storage schema definition language files (. ssdl)--Define the storage model, the definition of the object, also known as the logical Model (O)
Conceptual schema definition language files (. csdl)--Define a conceptual model, the definition of a table (R)
Mapping specification language file (. MSL)--defining the mapping between the storage model and the conceptual model (M)

The Entity Framework uses these XML-based models and mapping files to transform the creation, read, update, and delete operations of entities and relationships in the conceptual model into equivalent operations in the data source. The EDM even supports mapping entities in the conceptual model to stored procedures in the data source.

Introduction to Entity Framework

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.