다음을 통해 공유


Key 특성(EntityType SSDL)

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

Adventure Works 메타데이터에서의 다음 Department 엔터티 선언은 Key 할당을 보여 줍니다. Key="Department ID".

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

  <EntityType Name="Department">
    <Key>
        <PropertyRef Name="DepartmentID">
    </Key>
    <Property Name="DepartmentID" Type="smallint" Nullable="false"
                               StoreGeneratedPattern="Identity" />
    <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="50" />
    <Property Name="GroupName" Type="nvarchar" Nullable="false"
                                             MaxLength="50" />
    <Property Name="ModifiedDate" Type="datetime" Nullable="false" />
  </EntityType>

참고 항목

개념

Key 특성(EntityType CSDL)
AdventureWorks 전체 모델(EDM)