AssociationAttribute.OtherKey プロパティ

定義

関連付けのもう一方の側のキー値として、ターゲット エンティティ クラスの 1 つ以上のメンバーを取得または設定します。

public:
 property System::String ^ OtherKey { System::String ^ get(); void set(System::String ^ value); };
public string OtherKey { get; set; }
member this.OtherKey : string with get, set
Public Property OtherKey As String

プロパティ値

既定値 = 関連クラスの ID。

[Association(Name="FK_Products_Categories", Storage="_Products", OtherKey="CategoryID", DeleteRule="NO ACTION")]
public EntitySet<Product> Products
{
    get
    {
        return this._Products;
    }
    set
    {
        this._Products.Assign(value);
    }
}
<Association(Name:="FK_Products_Categories", Storage:="_Products", OtherKey:="CategoryID", DeleteRule:="NO ACTION")>
Public Property Products() As EntitySet(Of Product)
    Get
        Return Me._Products
    End Get
    Set
        Me._Products.Assign(Value)
    End Set
End Property

注釈

複数のメンバーの場合は、コンマ区切りのリストを使用します。

キーは主キーまたは外部キーと一致する必要はありませんが、ユーザーが指定したカーディナリティ ( EntityRef<TEntity> の場合は 0 から 1、 EntitySet<TEntity> の場合は 0-n) は true と見なされます。

適用対象