Delen via


OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.WithOwner Method

Definition

Overloads

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

Configures the relationship to the owner.

WithOwner(String)

Configures the relationship to the owner.

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

Configures the relationship to the owner.

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)

Parameters

referenceExpression
Expression<Func<TDependentEntity,TOwnerEntity>>

A lambda expression representing the reference navigation property pointing to the owner (blog => blog.BlogInfo). If no property is specified, the relationship will be configured without a navigation property pointing to the owner.

Returns

OwnershipBuilder<TOwnerEntity,TDependentEntity>

An object that can be used to configure the relationship.

Remarks

Note that calling this method with no parameters will explicitly configure this side of the relationship to use no navigation property, even if such a property exists on the entity type. If the navigation property is to be used, then it must be specified.

Applies to

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

Configures the relationship to the owner.

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)

Parameters

ownerReference
String

The name of the reference navigation property pointing to the owner. If null or not specified, there is no navigation property pointing to the owner.

Returns

OwnershipBuilder<TOwnerEntity,TDependentEntity>

An object that can be used to configure the relationship.

Remarks

Note that calling this method with no parameters will explicitly configure this side of the relationship to use no navigation property, even if such a property exists on the entity type. If the navigation property is to be used, then it must be specified.

Applies to