语言

OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.WithOwner 方法

定义

重载

名称 说明
WithOwner(Expression<Func<TDependentEntity,TOwnerEntity>>)

配置与所有者的关系。

WithOwner(String)

配置与所有者的关系。

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

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

Source:
OwnedNavigationBuilder`.cs
Source:
OwnedNavigationBuilder`.cs
Source:
OwnedNavigationBuilder`.cs
Source:
OwnedNavigationBuilder`.cs
Source:
OwnedNavigationBuilder`.cs
Source:
OwnedNavigationBuilder`.cs
Source:
OwnedNavigationBuilder`.cs
Source:
OwnedNavigationBuilder`.cs
Source:
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

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

返回

OwnershipBuilder<TOwnerEntity,TDependentEntity>

可用于配置关系的对象。

注解

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

适用于