Поделиться через


ScalarProperty Element (MSL)

In the Entity Data Model (EDM), the ScalarProperty element specifies the mapping between a property of an entity defined in conceptual schema definition language (CSDL) and a column in a database table described by the storage metadata.

The following example maps the properties of the Department entity in the AdventureWorksHRModel namespace to corresponding columns in the table identified by the TableName attribute of a MappingFragment element of which the ScalarProperty is a child element. In this example, all the properties of the Department have the same names as the corresponding columns in the table.

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

See Also

Concepts

EntityContainerMapping Element (MSL)
EntitySetMapping Element (MSL)
EntityTypeMapping Element (EntitySetMapping)
AdventureWorks Complete Model (EDM)