语言

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。

特性

适用于