Compartir a través de


OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.WithOwner Método

Definición

Sobrecargas

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

Configura la relación con el propietario.

WithOwner(String)

Configura la relación con el propietario.

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

Configura la relación con el propietario.

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)

Parámetros

referenceExpression
Expression<Func<TDependentEntity,TOwnerEntity>>

Expresión lambda que representa la propiedad de navegación de referencia que apunta al propietario (blog => blog.BlogInfo). Si no se especifica ninguna propiedad, la relación se configurará sin una propiedad de navegación que apunte al propietario.

Devoluciones

OwnershipBuilder<TOwnerEntity,TDependentEntity>

Objeto que se puede usar para configurar la relación.

Comentarios

Tenga en cuenta que llamar a este método sin parámetros configurará explícitamente este lado de la relación para que no use ninguna propiedad de navegación, incluso si existe dicha propiedad en el tipo de entidad. Si se va a usar la propiedad de navegación, debe especificarse.

Se aplica a

WithOwner(String)

Configura la relación con el propietario.

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)

Parámetros

ownerReference
String

Nombre de la propiedad de navegación de referencia que apunta al propietario. Si se especifica null o no se especifica, no hay ninguna propiedad de navegación que apunte al propietario.

Devoluciones

OwnershipBuilder<TOwnerEntity,TDependentEntity>

Objeto que se puede usar para configurar la relación.

Comentarios

Tenga en cuenta que llamar a este método sin parámetros configurará explícitamente este lado de la relación para que no use ninguna propiedad de navegación, incluso si existe dicha propiedad en el tipo de entidad. Si se va a usar la propiedad de navegación, debe especificarse.

Se aplica a