PropertyExtensions.GetContainingPrimaryKey(IProperty) 方法

定義

警告

Use FindContainingPrimaryKey()

取得使用此屬性的主鍵 (包含此屬性的複合主鍵) 。

public static Microsoft.EntityFrameworkCore.Metadata.IKey GetContainingPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IProperty property);
[System.Obsolete("Use FindContainingPrimaryKey()")]
public static Microsoft.EntityFrameworkCore.Metadata.IKey GetContainingPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IProperty property);
static member GetContainingPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IProperty -> Microsoft.EntityFrameworkCore.Metadata.IKey
[<System.Obsolete("Use FindContainingPrimaryKey()")>]
static member GetContainingPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IProperty -> Microsoft.EntityFrameworkCore.Metadata.IKey
<Extension()>
Public Function GetContainingPrimaryKey (property As IProperty) As IKey

參數

property
IProperty

要為其取得主鍵的屬性。

傳回

使用這個屬性的主鍵,如果 null 它不是主鍵的一部分,則為 。

屬性

適用於