Key 특성(EntityType CSDL)

EDM(엔터티 데이터 모델)에서 EntityType 요소의 Key 특성은 모든 작업에서 형식의 인스턴스를 식별하는 데 사용되는 속성을 지정합니다.

Department 엔터티의 다음 선언은 Key 할당을 보여 줍니다. Key="Department ID".

여기서 Property 정의는 16비트 정수입니다. 제약 조건 할당 Nullable="false"에 명시된 것처럼 Key 속성은 null이 될 수 없습니다.

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