Condividi tramite


Mapping Element (MSL)

The Mapping element is the root element used in a mapping specification language (MSL) schema in the Entity Data Model (EDM). The mapping element specifies mapping between types defined by using conceptual schema definition language (CSDL) and storage metadata in store schema definition language (SSDL).

The CSDL types become members of a class in the namespace of the CSDL schema. The SSDL types describe the database used to persist data for applications built on the data model being defined.

In the following example, the root element of a mapping specification contains the MSL Space="C-S" abbreviation that signifies the mapping between conceptual schema and storage schema (C-S). The XML namespace designation (xmlns) shown in the example is the same in all MSL schemas.

<?xml version="1.0" encoding="utf-8"?>
<Mapping Space="C-S" 
    xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">

    <EntitySetMapping Name="EmployeePayHistory">
      <EntityTypeMapping
          TypeName="AdventureWorksHRModel.EmployeePayHistory">
        <MappingFragment TableName="EmployeePayHistory">
          <ScalarProperty Name="EmployeeID"
                                        ColumnName="EmployeeID" />
          <ScalarProperty Name="RateChangeDate"
                               ColumnName="RateChangeDate" />
          <ScalarProperty Name="Rate" ColumnName="Rate" />
          <ScalarProperty Name="PayFrequency"
                                  ColumnName="PayFrequency" />
          <ScalarProperty Name="ModifiedDate"
                                  ColumnName="ModifiedDate" />
        </MappingFragment>
      </EntityTypeMapping>
    </EntitySetMapping>

See Also

Concepts

Conceptual Schema (CSDL)
Storage Metadata Schema (SSDL)

Other Resources

EDM Specifications