Share via


ReferenceOwnershipBuilder<TEntity,TRelatedEntity>.OwnsMany Method

Definition

Overloads

OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsMany<TDependentEntity>(String)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsMany<TDependentEntity>(String, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity> OwnsMany<TDependentEntity> (System.Linq.Expressions.Expression<Func<TRelatedEntity,System.Collections.Generic.IEnumerable<TDependentEntity>>> navigationExpression) where TDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'RelatedEntity, seq<'DependentEntity>>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'RelatedEntity, 'DependentEntity (requires 'RelatedEntity : null and 'DependentEntity : null)> (requires 'DependentEntity : null)
Public Overridable Function OwnsMany(Of TDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TRelatedEntity, IEnumerable(Of TDependentEntity)))) As CollectionOwnershipBuilder(Of TRelatedEntity, TDependentEntity)

Type Parameters

TDependentEntity

The entity type that this relationship targets.

Parameters

navigationExpression
Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>

A lambda expression representing the reference navigation property on this entity type that represents the relationship (customer => customer.Address).

Returns

CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>

An object that can be used to configure the owned type and the relationship.

Applies to

OwnsMany<TDependentEntity>(String)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

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

Type Parameters

TDependentEntity

The entity type that this relationship targets.

Parameters

navigationName
String

The name of the reference navigation property on this entity type that represents the relationship.

Returns

CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>

An object that can be used to configure the owned type and the relationship.

Applies to

OwnsMany<TDependentEntity>(Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<TEntity,TRelatedEntity> OwnsMany<TDependentEntity> (System.Linq.Expressions.Expression<Func<TRelatedEntity,System.Collections.Generic.IEnumerable<TDependentEntity>>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>> buildAction) where TDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'RelatedEntity, seq<'DependentEntity>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'RelatedEntity, 'DependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> (requires 'DependentEntity : null)
Public Overridable Function OwnsMany(Of TDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TRelatedEntity, IEnumerable(Of TDependentEntity))), buildAction As Action(Of CollectionOwnershipBuilder(Of TRelatedEntity, TDependentEntity))) As ReferenceOwnershipBuilder(Of TEntity, TRelatedEntity)

Type Parameters

TDependentEntity

The entity type that this relationship targets.

Parameters

navigationExpression
Expression<Func<TRelatedEntity,IEnumerable<TDependentEntity>>>

A lambda expression representing the reference navigation property on this entity type that represents the relationship (customer => customer.Address).

buildAction
Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>

An action that performs configuration of the owned type and the relationship.

Returns

An object that can be used to configure the entity type.

Applies to

OwnsMany<TDependentEntity>(String, Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<TEntity,TRelatedEntity> OwnsMany<TDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>> buildAction) where TDependentEntity : class;
override this.OwnsMany : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'RelatedEntity, 'DependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> (requires 'DependentEntity : null)
Public Overridable Function OwnsMany(Of TDependentEntity As Class) (navigationName As String, buildAction As Action(Of CollectionOwnershipBuilder(Of TRelatedEntity, TDependentEntity))) As ReferenceOwnershipBuilder(Of TEntity, TRelatedEntity)

Type Parameters

TDependentEntity

The entity type that this relationship targets.

Parameters

navigationName
String

The name of the reference navigation property on this entity type that represents the relationship.

buildAction
Action<CollectionOwnershipBuilder<TRelatedEntity,TDependentEntity>>

An action that performs configuration of the owned type and the relationship.

Returns

An object that can be used to configure the entity type.

Applies to