Partager via


TypeName Attribute (EntityTypeMapping)

In the Entity Data Model (EDM), the TypeName attribute of the EntityTypeMapping element specifies the fully qualified name of the entity in the conceptual schema that is being mapped to a table described in the storage metadata. The TypeName attribute on an EntityType element in mapping specification language (MSL) can accept both fully qualified name of the type or IsTypeOf("fully qualified Name"), which is useful mainly when defining mapping in inheritance scenarios. For more information, see Inheritance (EDM).

The following syntax includes the EntitySetMapping element that contains the EntityTypeMapping element whose TypeName attribute identifies the Department entity in the AdventureWorksHRModel entity container. The MappingFragment and ScalarProperty elements map the Department entity and its properties to a table and its columns.

    <EntitySetMapping Name="Department">

      <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>

    </EntitySetMapping>

See Also

Concepts

EntityType Element (CSDL)
EntityType Element (SSDL)
EntityContainer Element (CSDL)
EntityContainer Element (SSDL)
EntityContainerMapping Element (MSL)
AdventureWorks Complete Model (EDM)