MutableEntityTypeExtensions.GetOrAddKey 方法

定义

重载

GetOrAddKey(IMutableEntityType, IMutableProperty)

获取对属性定义的现有备用键,如果尚未定义,则创建一个新备用键。

GetOrAddKey(IMutableEntityType, IReadOnlyList<IMutableProperty>)

获取在一组属性上定义的现有备用键,或者创建一个新键(如果尚未定义)。

GetOrAddKey(IMutableEntityType, IMutableProperty)

获取对属性定义的现有备用键,如果尚未定义,则创建一个新备用键。

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

参数

entityType
IMutableEntityType

要获取或创建备用键的实体类型。

property
IMutableProperty

用作备用键的属性。

返回

现有或新创建的备用密钥。

适用于

GetOrAddKey(IMutableEntityType, IReadOnlyList<IMutableProperty>)

获取在一组属性上定义的现有备用键,或者创建一个新键(如果尚未定义)。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableKey GetOrAddKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties);
static member GetOrAddKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
<Extension()>
Public Function GetOrAddKey (entityType As IMutableEntityType, properties As IReadOnlyList(Of IMutableProperty)) As IMutableKey

参数

entityType
IMutableEntityType

要获取或创建备用键的实体类型。

properties
IReadOnlyList<IMutableProperty>

用作备用键的属性。

返回

现有或新创建的备用密钥。

适用于