다음을 통해 공유


Annotation 요소(SSDL)

SSDL(저장소 스키마 정의 언어)의 Annotation 요소는 저장소 모델에서 저장소 모델에 대한 추가 메타데이터를 제공하는 사용자 지정 XML 요소입니다. Annotation 요소는 올바른 XML 구조를 가져야 함은 물론 다음 제약 조건이 적용됩니다.

  • Annotation 요소는 SSDL용으로 예약된 XML 네임스페이스에 속하지 않아야 합니다.

  • 두 Annotation 요소의 정규화된 이름은 서로 같을 수 없습니다.

  • Annotation 요소는 제공된 SSDL 요소의 다른 모든 자식 요소 뒤에 나타나야 합니다.

두 개 이상의 Annotation 요소가 제공된 SSDL 요소의 자식이 될 수 있습니다. .NET Framework 버전 4부터 Annotation 요소에 포함된 메타데이터는 런타임에 System.Data.Metadata.Edm 네임스페이스의 클래스를 사용하여 액세스할 수 있습니다.

예제

다음 예제에서는 Annotation 요소(CustomElement)가 포함된 EntityType 요소를 보여 줍니다. 이 예제에서는 OrderId 속성에 적용된 주석 특성도 보여 줍니다.

<EntityType Name="Orders" xmlns:c="http://CustomNamespace">
  <Key>
    <PropertyRef Name="OrderId" />
  </Key>
  <Property Name="OrderId" Type="int" Nullable="false" 
            c:CustomAttribute="someValue"/>
  <Property Name="ProductId" Type="int" Nullable="false" />
  <Property Name="Quantity" Type="int" Nullable="false" />
  <Property Name="CustomerId" Type="int" Nullable="false" />
  <c:CustomElement>
    Custom data here.
  </c:CustomElement>
</EntityType>

참고 항목

개념

주석 특성(SSDL)
SSDL 사양

기타 리소스

CSDL, SSDL 및 MSL 사양