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 為 。

屬性

適用於