EntityFramework (1), entityframework

Source: Internet
Author: User

EntityFramework (1), entityframework

The core of EntityFramework is the EDM Entity Data Model, which consists of three parts.

(1) the conceptual model is defined by the conceptual Architecture Definition Language file (. csdl.

(2) ing, defined by the ing specification language file (. msl.

(3) the storage model is defined by the storage Architecture Definition Language file (. ssdl), also known as the logical model.

The above concepts are abstract. In the final analysis, EDM can be considered as an XML file, which contains three parts: CSDL, MSL, and SSDL.

1) CSDL is a common entity class.

This section (XML) contains entities, attributes, primary keys, associations, and so on. The general structure is as follows:

<EntityContainer Name = "A">

<FunctionImport/>

<EntitySet Name = "Customer" EntityType = "ASSModel. Customer"/>

<AssociationSet/>

<EntityType Name = "Customer">

<Key> <PropertyRef Name = "CustomerId_Guid"/> </Key>

<Property Name = "CustomerId_Guid" Type = "Guid" Nullable = "false"/>

<Property Name = "CustomerName_Nvarchar" Type = "String" Nullable = "false" MaxLength = "200" Unicode = "true" FixedLength = "true"/>

</EntityType>

</EntityContainer>

2) SSDL, similar to the CSDL file structure, tends to be described in the Database concept. The general structure is as follows:

<EntityContainer Name = "B">

...

</EntityContainer>

<EntityType>

<Property Name = "CustomerName_Nvarchar" Type = "nvarchar" MaxLength = "200"/>

...

</EntityType>

3) MSL describes the ing between CSDL and SSDL, including the ing between attributes in CSDL and columns in SSDL. The general structure is as follows:

<EntityContainerMapping StorageEntityContainer = "B" CdmEntityContainer = "A">

<EntitySetMapping Name = "Assignments">

<EntityTypeMapping TypeName = "IsTypeOf (ASSModel. Assignments)">

<MappingFragment StoreEntitySet = "Assignments">

<ScalarProperty Name = "CustomerName_Nvarchar" ColumnName = "CustomerName_Nvarchar"/>

</MappingFragment>

</EntityTypeMapping>

</EntitySetMapping>

</EntityContainerMapping>

 

There are still many details in the XML file. You can build an EDM to open it and have a look.

 

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.