語言

OwnedNavigationBuilder.WithOwner(String) 方法

定義

設定與擁有者的關係。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder WithOwner(string? ownerReference = default);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder WithOwner(string ownerReference = default);
abstract member WithOwner : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder
override this.WithOwner : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder
Public Overridable Function WithOwner (Optional ownerReference As String = Nothing) As OwnershipBuilder

參數

ownerReference
String

指的是該參考航道物業的名稱,指向所有者。 若 為零或未指定,則無指向擁有者的導航屬性。

傳回

一個可以用來設定關係的物件。

備註

請注意,呼叫此方法時若無參數,會明確設定此關係的這一端不使用導航屬性,即使實體類型中存在此類屬性。 若要使用導航性質,則必須指定該性質。

適用於