语言

PropertyExtensions.GetContainingPrimaryKey(IProperty) 方法

定义

注意

Use FindContainingPrimaryKey()

获取使用此属性的主键(包括包含此属性的复合主键)。

public static Microsoft.EntityFrameworkCore.Metadata.IKey GetContainingPrimaryKey(this Microsoft.EntityFrameworkCore.Metadata.IProperty property);
[System.Obsolete("Use FindContainingPrimaryKey()")]
public static Microsoft.EntityFrameworkCore.Metadata.IKey GetContainingPrimaryKey(this Microsoft.EntityFrameworkCore.Metadata.IProperty property);
static member GetContainingPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IProperty -> Microsoft.EntityFrameworkCore.Metadata.IKey
[<System.Obsolete("Use FindContainingPrimaryKey()")>]
static member GetContainingPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IProperty -> Microsoft.EntityFrameworkCore.Metadata.IKey
<Extension()>
Public Function GetContainingPrimaryKey (property As IProperty) As IKey

参数

property
IProperty

要为其获取主键的属性。

返回

使用此属性的主密钥,或者 null 它不是主键的一部分。

特性

适用于