EF (Entity framwork) structure

Source: Internet
Author: User

The first contact with EF, read some information, the understanding of the EF structure of the following records:

At the core of EF is the EDM----Entity Data Model (. edmx). It consists of three components: a conceptual model (. csdl file), a storage model (. ssdl file), a mapping specification (. msl file).

Conceptual model: In EF, it refers to an entity class. public class class Name {

Attribute 1;

Attribute 2;

...}


Storage model: In EF, it refers to the entities in the database (the form in which the relationships of individual entities are pinned to the table).


Mapping: Connect the conceptual model and the storage model for operation.
That is: (conceptual model) entity. Properties <----> (storage model) entities. Fields

Understanding EF First understands the following concepts, which demonstrate the correspondence between the conceptual model and the storage model. Inside the parentheses are the storage models, which are specific instructions for easy comprehension
1: Entity class: Entities. Its name is typically the table name of the associated database table. It inherits from the Entityobject class. Used to describe the attributes of an entity, and an entity class defines one or more properties.

(In the conceptual model: an object of an entity class is a row in a table)
2: Entity set: objectquery< entity >. One or more entity classes form an entity set.

(In the conceptual model: a table consisting of multiple rows of data)
3: Entity container: EntityContainer it inherits from ObjectContext. The entity set is defined in the container.

(In the conceptual model: a database consisting of multiple tables)
4: Entity key: EntityKey refers to the name of an attribute in an entity class.

(In the conceptual model: is a collection of fields.) )


The containment relationship between them is: Entity container---> Entity set-----> Entity class-----> entity key
When we add an associated. Net entity Date model, both the entity class and the entity container are automatically generated.

                               

EF (Entity framwork) structure

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.