MutableEntityTypeExtensions.AddKey 方法

定义

向此实体类型添加新的备用键。

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

参数

entityType
IMutableEntityType

实体类型。

property
IMutableProperty

要用作备用键的属性。

返回

新创建的密钥。

适用于