AssociationAttribute.OtherKey Właściwość

Definicja

Pobiera lub ustawia jeden lub więcej elementów członkowskich docelowej klasy jednostki jako wartości klucza po drugiej stronie skojarzenia.

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

Wartość właściwości

Default = identyfikator powiązanej klasy.

Przykłady

[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

Uwagi

W przypadku wielu członków użyj listy rozdzielanej przecinkami.

Klucz nie jest wymagany do dopasowania klucza podstawowego lub klucza obcego, ale przyjmuje się, że kardynalność określona przez użytkownika (0–1 dla EntityRef<TEntity> lub 0-n dla EntitySet<TEntity>) ma wartość true.

Dotyczy