Partager via


Name Attribute (ScalarProperty)

In the Entity Data Model (EDM), there are two Name attributes of the ScalarProperty. The first Name specifies a property of an EntityType in the conceptual schema, and the second Name specifies a column in a database table described by the storage metadata.

The EntityTypeMapping element identifies an entity and a namespace defined in conceptual schema definition language (CSDL). The MappingFragment and ScalarProperty mappings connect properties of an entity to columns of a table in the database.

The following example shows the properties of a Department entity mapped to corresponding columns in a Department table. In this example, the names of properties of entities in the conceptual schema match the column names in the table. This is convenient but not required.

<EntityTypeMapping TypeName="AdventureWorksHRModel.Department">

        <MappingFragment TableName="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

MappingFragment Element (MSL)
EntityContainerMapping Element (MSL)
EntityContainer Element (CSDL)
EntityContainer Element (SSDL)