ReferenceOwnershipBuilder.HasPrincipalKey(String[]) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
配置此關係所針對的獨特屬性——也就是所有者實體類型。 通常只有當你想使用主鍵以外的屬性作為主要屬性時,才會呼叫此方法。 若指定的屬性尚未是唯一限制(或主鍵),則會引入新的唯一限制。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder HasPrincipalKey(params string[] keyPropertyNames);
abstract member HasPrincipalKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder
override this.HasPrincipalKey : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder
Public Overridable Function HasPrincipalKey (ParamArray keyPropertyNames As String()) As ReferenceOwnershipBuilder
參數
- keyPropertyNames
- String[]
參考金鑰屬性的名稱。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
若指定多個主鍵屬性,主鍵屬性的順序應與主鍵或唯一約束屬性在主實體類型上配置的順序相符。