IMutableEntityType.SetPrimaryKey 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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>
构成主键的属性。
返回
新创建的密钥。