CollectionOwnershipBuilder<TEntity,TDependentEntity>.OwnsMany Method

Definition

Overloads

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

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<TNewDependentEntity>(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<TNewDependentEntity>(Expression<Func<TDependentEntity, IEnumerable<TNewDependentEntity>>>, Action<CollectionOwnershipBuilder<TDependentEntity, TNewDependentEntity>>)

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<TNewDependentEntity>(String, Action<CollectionOwnershipBuilder<TDependentEntity,TNewDependentEntity>>)

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<TNewDependentEntity>(Expression<Func<TDependentEntity,IEnumerable<TNewDependentEntity>>>)

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<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>>> navigationExpression) where TNewDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity)))) As CollectionOwnershipBuilder(Of TDependentEntity, TNewDependentEntity)

Type Parameters

TNewDependentEntity

The entity type that this relationship targets.

Parameters

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

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

Returns

CollectionOwnershipBuilder<TDependentEntity,TNewDependentEntity>

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

Applies to

OwnsMany<TNewDependentEntity>(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<TDependentEntity,TNewDependentEntity> OwnsMany<TNewDependentEntity> (string navigationName) where TNewDependentEntity : class;
override this.OwnsMany : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationName As String) As CollectionOwnershipBuilder(Of TDependentEntity, TNewDependentEntity)

Type Parameters

TNewDependentEntity

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<TDependentEntity,TNewDependentEntity>

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

Applies to

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

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<TEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,System.Collections.Generic.IEnumerable<TNewDependentEntity>>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsMany : System.Linq.Expressions.Expression<Func<'DependentEntity, seq<'NewDependentEntity>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, IEnumerable(Of TNewDependentEntity))), buildAction As Action(Of CollectionOwnershipBuilder(Of TDependentEntity, TNewDependentEntity))) As CollectionOwnershipBuilder(Of TEntity, TDependentEntity)

Type Parameters

TNewDependentEntity

The entity type that this relationship targets.

Parameters

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

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

buildAction
Action<CollectionOwnershipBuilder<TDependentEntity,TNewDependentEntity>>

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<TNewDependentEntity>(String, Action<CollectionOwnershipBuilder<TDependentEntity,TNewDependentEntity>>)

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<TEntity,TDependentEntity> OwnsMany<TNewDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsMany : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.CollectionOwnershipBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsMany(Of TNewDependentEntity As Class) (navigationName As String, buildAction As Action(Of CollectionOwnershipBuilder(Of TDependentEntity, TNewDependentEntity))) As CollectionOwnershipBuilder(Of TEntity, TDependentEntity)

Type Parameters

TNewDependentEntity

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<TDependentEntity,TNewDependentEntity>>

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