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.