ConventionEntityTypeExtensions.FindKey 方法

定義

取得在指定屬性上定義的主要或替代索引鍵。 null如果未為指定的屬性定義任何索引鍵,則傳回 。

public static Microsoft.EntityFrameworkCore.Metadata.IConventionKey FindKey (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IProperty property);
static member FindKey : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * Microsoft.EntityFrameworkCore.Metadata.IProperty -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
<Extension()>
Public Function FindKey (entityType As IConventionEntityType, property As IProperty) As IConventionKey

參數

entityType
IConventionEntityType

實體類型。

property
IProperty

索引鍵定義所在的屬性。

傳回

如果未定義索引鍵,則為 null。

適用於