MutableEntityTypeExtensions.FindKey(IMutableEntityType, IProperty) 方法

定義

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

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

參數

entityType
IMutableEntityType

實體類型。

property
IProperty

索引鍵定義所在的屬性。

傳回

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

適用於