Share via


annotation 属性 (SSDL)

ストア スキーマ定義言語 (SSDL) の annotation 属性は、ストレージ モデルの要素に関する追加のメタデータを指定するストレージ モデルのカスタム XML 属性です。 有効な XML 構造が必要であることに加え、annotation 属性には次の制約が適用されます。

  • annotation 属性は、SSDL 用に予約された XML 名前空間に存在しない。

  • 2 つの任意の annotation 属性の完全修飾名が同じではない。

複数の annotation 属性を特定の 1 つの SSDL 要素に適用することができる。 annotation 要素に含まれるメタデータには、System.Data.Metadata.Edm 名前空間内のクラスを使用して実行時にアクセスできます。

次の例は、OrderId プロパティに適用される annotation 属性を備えた EntityType 要素を示しています。 また、EntityType 要素に追加された annotation 要素も示しています。

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

参照

概念

annotation 要素 (SSDL)
SSDL 仕様

その他のリソース

CSDL、SSDL、および MSL 仕様