Share via


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>

組成主鍵的屬性。

傳回

新建立的索引鍵。

適用於