OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.OwnsOne 方法

定义

重载

OwnsOne(String, String, Action<OwnedNavigationBuilder>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne(Type, String, Action<OwnedNavigationBuilder>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne(String, Type, String, Action<OwnedNavigationBuilder>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(String, String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(String, String)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(String)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

OwnsOne(String, String, Action<OwnedNavigationBuilder>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsOne (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

参数

ownedTypeName
String

此关系所面向的实体类型的名称。

navigationName
String

此实体类型上表示关系的引用导航属性的名称。

buildAction
Action<OwnedNavigationBuilder>

执行关系配置的操作。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航属于同一类型。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对自有实体的大多数操作都需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 的 WithOwner 调用以完全配置关系。

适用于

OwnsOne(Type, String, Action<OwnedNavigationBuilder>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne (Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne (Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsOne : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsOne : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsOne (ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne (ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

参数

ownedType
Type

此关系所面向的实体类型。

navigationName
String

此实体类型上表示关系的引用导航属性的名称。

buildAction
Action<OwnedNavigationBuilder>

执行关系配置的操作。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航属于同一类型。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对自有实体的大多数操作都需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 的 WithOwner 调用以完全配置关系。

适用于

OwnsOne(String, Type, String, Action<OwnedNavigationBuilder>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne (string ownedTypeName, Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne (string ownedTypeName, Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsOne : string * Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsOne : string * Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsOne (ownedTypeName As String, ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne (ownedTypeName As String, ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

参数

ownedTypeName
String

此关系所面向的实体类型的名称。

ownedType
Type

此关系所面向的实体类型的 CLR 类型。

navigationName
String

此实体类型上表示关系的引用导航属性的名称。

buildAction
Action<OwnedNavigationBuilder>

执行关系配置的操作。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航属于同一类型。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对自有实体的大多数操作都需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 的 WithOwner 调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(String, String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

类型参数

TNewDependentEntity

此关系所面向的实体类型。

参数

ownedTypeName
String

此关系所面向的实体类型的名称。

navigationName
String

此实体类型上表示关系的引用导航属性的名称。

buildAction
Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>

执行关系配置的操作。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航属于同一类型。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对自有实体的大多数操作都需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 的 WithOwner 调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : string * System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : string * System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

类型参数

TNewDependentEntity

此关系所面向的实体类型。

参数

ownedTypeName
String

此关系所面向的实体类型的名称。

navigationExpression
Expression<Func<TDependentEntity,TNewDependentEntity>>

一个 lambda 表达式,表示此实体类型上的引用导航属性,表示 () customer => customer.Address 的关系。

buildAction
Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>

执行关系配置的操作。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航属于同一类型。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对自有实体的大多数操作都需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 的 WithOwner 调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(String, String)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, string navigationName) where TNewDependentEntity : class;
override this.OwnsOne : string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)

类型参数

TNewDependentEntity

此关系面向的实体类型。

参数

ownedTypeName
String

此关系所面向的实体类型的名称。

navigationName
String

此实体类型上表示关系的引用导航属性的名称。

返回

OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航属于同一类型。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对拥有实体的大多数操作需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 WithOwner 的调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression) where TNewDependentEntity : class;
override this.OwnsOne : string * System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)

类型参数

TNewDependentEntity

此关系面向的实体类型。

参数

ownedTypeName
String

此关系所面向的实体类型的名称。

navigationExpression
Expression<Func<TDependentEntity,TNewDependentEntity>>

一个 lambda 表达式,表示此实体类型上的引用导航属性,表示 (customer => customer.Address) 的关系。

返回

OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航的类型相同。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对拥有实体的大多数操作需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 WithOwner 的调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

类型参数

TNewDependentEntity

此关系面向的实体类型。

参数

navigationName
String

此实体类型上表示关系的引用导航属性的名称。

buildAction
Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>

执行关系配置的操作。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航的类型相同。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对拥有实体的大多数操作需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 WithOwner 的调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(String)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string navigationName) where TNewDependentEntity : class;
override this.OwnsOne : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationName As String) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)

类型参数

TNewDependentEntity

此关系面向的实体类型。

参数

navigationName
String

此实体类型上表示关系的引用导航属性的名称。

返回

OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航的类型相同。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对拥有实体的大多数操作需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 WithOwner 的调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity,TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression) where TNewDependentEntity : class;
override this.OwnsOne : System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)

类型参数

TNewDependentEntity

此关系面向的实体类型。

参数

navigationExpression
Expression<Func<TDependentEntity,TNewDependentEntity>>

一个 lambda 表达式,表示此实体类型上的引用导航属性,表示 (customer => customer.Address) 的关系。

返回

OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航的类型相同。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对拥有实体的大多数操作需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 WithOwner 的调用以完全配置关系。

适用于

OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)

配置目标实体由 (或) 此实体的一部分拥有的关系。 目标实体键值始终从它所属的实体传播。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)

类型参数

TNewDependentEntity

此关系面向的实体类型。

参数

navigationExpression
Expression<Func<TDependentEntity,TNewDependentEntity>>

一个 lambda 表达式,表示此实体类型上的引用导航属性,表示 (customer => customer.Address) 的关系。

buildAction
Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>

执行关系配置的操作。

返回

OwnedNavigationBuilder<TEntity,TDependentEntity>

可用于配置实体类型的 对象。

注解

每个所有权关系的目标实体类型被视为不同的实体类型,即使导航的类型相同。 目标实体类型的配置不会应用于其他所有权关系的目标实体类型。

对拥有实体的大多数操作需要使用相应的导航通过所有者实体访问它。

调用此方法后,应链接对 WithOwner 的调用以完全配置关系。

适用于