Share via


PrimaryKeyAttribute 클래스

정의

이 CLR 형식에 매핑된 엔터티 형식의 기본 키를 지정합니다.

[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class PrimaryKeyAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type PrimaryKeyAttribute = class
    inherit Attribute
Public NotInheritable Class PrimaryKeyAttribute
Inherits Attribute
상속
PrimaryKeyAttribute
특성

설명

이 특성은 단일 속성으로 구성된 키와 여러 속성으로 구성된 복합 키에 모두 사용할 수 있습니다. KeyAttribute 은 단일 속성 키에 대신 사용할 수 있습니다. 이 경우 동작이 동일합니다. 두 특성을 모두 사용하는 경우 이 특성이 우선합니다.

자세한 내용 과 예제는 엔터티 형식 및 관계 모델링 을 참조하세요.

생성자

PrimaryKeyAttribute(String, String[])

PrimaryKeyAttribute 클래스의 새 인스턴스를 초기화합니다.

속성

PropertyNames

기본 키를 구성하는 속성(순서대로)입니다.

적용 대상