ReferenceOwnershipBuilder.HasKey(String[]) 方法

定义

设置构成此自有实体类型的主键的属性。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.KeyBuilder HasKey (params string[] propertyNames);
abstract member HasKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.KeyBuilder
override this.HasKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.KeyBuilder
Public Overridable Function HasKey (ParamArray propertyNames As String()) As KeyBuilder

参数

propertyNames
String[]

构成主键的属性的名称。

返回

可用于配置主键的 对象。

适用于