EntityTypeExtensions.FindKey(IEntityType, IProperty) 方法

定義

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

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

參數

entityType
IEntityType

實體類型。

property
IProperty

索引鍵定義所在的屬性。

傳回

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

適用於