MappingFragment Element (MSL)

In the Entity Data Model (EDM), the MappingFragment element specifies a table in storage corresponding to an EntityType specified by the TypeName attribute of the EntityTypeMapping element of the mapping specification.

The following example shows the Department entity mapping in the AdventureWorksHRModel namespace. The MappingFragment element identifies a StoreEntitySet named Department in the storage schema. Each property of the Department entity is mapped to a column of the table in ScalarProperty and ColumnName attributes of the MappingFragment element.

      <EntityTypeMapping
                  TypeName="AdventureWorksHRModel.Department">

        <MappingFragment StoreEntitySet="Department">
          <ScalarProperty Name="DepartmentID"
                                 ColumnName="DepartmentID" />
          <ScalarProperty Name="Name" ColumnName="Name" />
          <ScalarProperty Name="GroupName"
                                     ColumnName="GroupName" />
          <ScalarProperty Name="ModifiedDate"
                                 ColumnName="ModifiedDate" />
        </MappingFragment>

      </EntityTypeMapping>

See Also

Concepts

ScalarProperty Element (MSL)
ColumnName Attribute (ScalarProperty MSL)
EntitySetMapping Element (MSL)
EntityContainerMapping Element (MSL)
AdventureWorks Complete Model (EDM)