IMutableEntityType.SetPrimaryKey 方法

定义

重载

SetPrimaryKey(IMutableProperty)

设置此实体类型的主键。

SetPrimaryKey(IReadOnlyList<IMutableProperty>)

设置此实体类型的主键。

SetPrimaryKey(IMutableProperty)

设置此实体类型的主键。

public virtual Microsoft.EntityFrameworkCore.Metadata.IMutableKey SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property);
public virtual Microsoft.EntityFrameworkCore.Metadata.IMutableKey? SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IMutableProperty? property);
abstract member SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IMutableProperty -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
override this.SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IMutableProperty -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
Public Overridable Function SetPrimaryKey (property As IMutableProperty) As IMutableKey

参数

property
IMutableProperty

主键属性。

返回

新创建的密钥。

适用于

SetPrimaryKey(IReadOnlyList<IMutableProperty>)

设置此实体类型的主键。

public Microsoft.EntityFrameworkCore.Metadata.IMutableKey SetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties);
public Microsoft.EntityFrameworkCore.Metadata.IMutableKey? SetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty>? properties);
abstract member SetPrimaryKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
Public Function SetPrimaryKey (properties As IReadOnlyList(Of IMutableProperty)) As IMutableKey

参数

properties
IReadOnlyList<IMutableProperty>

构成主键的属性。

返回

新创建的密钥。

适用于