語言

OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.WithOwner 方法

定義

多載

名稱 Description
WithOwner(Expression<Func<TDependentEntity,TOwnerEntity>>)

設定與擁有者的關係。

WithOwner(String)

設定與擁有者的關係。

WithOwner(Expression<Func<TDependentEntity,TOwnerEntity>>)

來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs

設定與擁有者的關係。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder<TOwnerEntity,TDependentEntity> WithOwner(System.Linq.Expressions.Expression<Func<TDependentEntity,TOwnerEntity?>>? referenceExpression);
override this.WithOwner : System.Linq.Expressions.Expression<Func<'DependentEntity, 'OwnerEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function WithOwner (referenceExpression As Expression(Of Func(Of TDependentEntity, TOwnerEntity))) As OwnershipBuilder(Of TOwnerEntity, TDependentEntity)

參數

referenceExpression
Expression<Func<TDependentEntity,TOwnerEntity>>

一個 lambda 運算式,代表指向擁有者(blog => blog.BlogInfo)的參考導航屬性。 若未指定屬性,則該關係配置時不會有指向所有者的導航屬性。

傳回

OwnershipBuilder<TOwnerEntity,TDependentEntity>

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

備註

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

適用於

WithOwner(String)

來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs

設定與擁有者的關係。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder<TOwnerEntity,TDependentEntity> WithOwner(string? ownerReference = default);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder<TEntity,TDependentEntity> WithOwner(string ownerReference = default);
override this.WithOwner : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
override this.WithOwner : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
Public Overridable Function WithOwner (Optional ownerReference As String = Nothing) As OwnershipBuilder(Of TOwnerEntity, TDependentEntity)
Public Overridable Function WithOwner (Optional ownerReference As String = Nothing) As OwnershipBuilder(Of TEntity, TDependentEntity)

參數

ownerReference
String

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

傳回

OwnershipBuilder<TOwnerEntity,TDependentEntity>

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

備註

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

適用於