語言

PropertyExtensions.IsPrimaryKey(IProperty) 方法

定義

警告

Use IReadOnlyProperty.IsPrimaryKey

會獲得一個值,表示此屬性是否被用作主鍵(或複合主鍵的一部分)。

public static bool IsPrimaryKey(this Microsoft.EntityFrameworkCore.Metadata.IProperty property);
[System.Obsolete("Use IReadOnlyProperty.IsPrimaryKey")]
public static bool IsPrimaryKey(this Microsoft.EntityFrameworkCore.Metadata.IProperty property);
static member IsPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IProperty -> bool
[<System.Obsolete("Use IReadOnlyProperty.IsPrimaryKey")>]
static member IsPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IProperty -> bool
<Extension()>
Public Function IsPrimaryKey (property As IProperty) As Boolean

參數

property
IProperty

該物業值得檢查。

傳回

true 若屬性作為主鍵,則 false。

屬性

適用於