OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.WithOwner 方法

定义

重载

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

配置与所有者的关系。

WithOwner(String)

配置与所有者的关系。

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

Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.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)

Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs

配置与所有者的关系。

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

参数

ownerReference
String

指向所有者的引用导航属性的名称。 如果为 null 或未指定,则没有指向所有者的导航属性。

返回

OwnershipBuilder<TOwnerEntity,TDependentEntity>

可用于配置关系的 对象。

注解

请注意,在没有参数的情况下调用此方法会将关系的这一端显式配置为不使用导航属性,即使实体类型上存在此类属性也是如此。 如果要使用导航属性,则必须指定它。

适用于