Share via


PropertyRef 要素 (SSDL)

ストア スキーマ定義言語 (SSDL) の PropertyRef 要素は、EntityType 要素に定義されたプロパティを参照して、そのプロパティが次の役割のいずれかを果たすことを示します。

  • EntityType が表すテーブルの主キーの一部になる。 PropertyRef 要素を 1 つ以上使用して、主キーを定義することができます。 For more information, see Key element.

  • 参照に関する制約の依存 End またはプリンシパル End になる。 For more information, see ReferentialConstraint element.

PropertyRef 要素には、次の子要素のみを含めることができます。

適用可能な属性

The table below describes the attributes that can be applied to the PropertyRef element.

属性名 必須 Value

Name

有効

参照されているプロパティの名前。

Ee705458.note(ja-jp,VS.100).gif注 :
PropertyRef 要素には、任意の数の annotation 属性 (カスタム XML 属性) を適用できます。However, custom attributes may not belong to any XML namespace that is reserved for CSDL.カスタム属性の完全修飾名は一意である必要があります。

次の例は、EntityType 要素に定義されたプロパティを参照して主キーを定義するときに使用する PropertyRef 要素を示します。

<EntityType Name="Customers">
  <Documentation>
    <Summary>Summary here.</Summary>
    <LongDescription>Long description here.</LongDescription>
  </Documentation>
  <Key>
    <PropertyRef Name="CustomerId" />
  </Key>
  <Property Name="CustomerId" Type="int" Nullable="false" />
  <Property Name="Name" Type="nvarchar(max)" Nullable="false" />
</EntityType>

参照

概念

エンティティ フレームワークの概要
SSDL 仕様

その他のリソース

CSDL、SSDL、および MSL 仕様
ADO.NET Entity Data Model Tools