MutableEntityTypeExtensions.SetPrimaryKey 方法

定義

設定這個實體類型的主鍵。

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

參數

entityType
IMutableEntityType

要設定索引鍵的實體類型。

property
IMutableProperty

主鍵屬性。

傳回

新建立的金鑰。

適用於