Type 属性 (EntityType CSDL)

在 实体数据模型 (EDM) 中,Property 元素的 Type 属性指定可以分配给类型实例的数据类型。

以下 Department 实体的定义包括 4 个 Property 元素。每个属性 (Property) 都有一个使用已分配数据类型的 Type 属性 (Attribute)。例如,DepartmentID 属性分配是 Type="Int16"DepartmentID 属性还被指定为 Department 实体的 Key 属性。

  <EntityType Name="Department" >
    <Key>
        <PropertyRef Name="DepartmentID">
    </Key>
    <Property Name="DepartmentID" Type="Int16" Nullable="false" />
    <Property Name="Name" Type="String" Nullable="false" />
    <Property Name="GroupName" Type="String" Nullable="false" />
    <Property Name="ModifiedDate" Type="DateTime" Nullable="false" />
  </EntityType>

另请参见

概念

Key 属性 (EntityType CSDL)
EntityType 元素 (SSDL)