共用方式為


OwnedNavigationBuilder.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[]

組成主鍵的屬性名稱。

傳回

可用來設定主鍵的物件。

適用於