Class CollectionCollectionBuilder
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.dll
Provides a simple API for configuring a one-to-many relationship.
public class CollectionCollectionBuilder
- Inheritance
-
CollectionCollectionBuilder
- Derived
- Inherited Members
Remarks
Instances of this class are returned from methods when using the ModelBuilder API and it is not designed to be directly constructed in your application code.
See Modeling entity types and relationships for more information and examples.
Constructors
CollectionCollectionBuilder(IMutableEntityType, IMutableEntityType, IMutableSkipNavigation, IMutableSkipNavigation)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
[EntityFrameworkInternal]
public CollectionCollectionBuilder(IMutableEntityType leftEntityType, IMutableEntityType rightEntityType, IMutableSkipNavigation leftNavigation, IMutableSkipNavigation rightNavigation)
Parameters
leftEntityType
IMutableEntityTyperightEntityType
IMutableEntityTypeleftNavigation
IMutableSkipNavigationrightNavigation
IMutableSkipNavigation
Properties
LeftEntityType
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
[EntityFrameworkInternal]
protected virtual IMutableEntityType LeftEntityType { get; }
Property Value
LeftNavigation
One of the navigations involved in the relationship.
public virtual IMutableSkipNavigation LeftNavigation { get; }
Property Value
ModelBuilder
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
[EntityFrameworkInternal]
protected virtual InternalModelBuilder ModelBuilder { get; }
Property Value
RightEntityType
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
[EntityFrameworkInternal]
protected virtual IMutableEntityType RightEntityType { get; }
Property Value
RightNavigation
One of the navigations involved in the relationship.
public virtual IMutableSkipNavigation RightNavigation { get; }
Property Value
Methods
UsingEntity(Action<EntityTypeBuilder>)
Configures the join entity type implementing the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.
UsingEntity(Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft)
Parameters
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
Returns
- EntityTypeBuilder
The builder for the join entity type.
UsingEntity(Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Action<EntityTypeBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft, Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.
UsingEntity(string)
Configures the join entity type implementing the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName)
Parameters
joinEntityName
stringThe name of the join entity.
Returns
- EntityTypeBuilder
The builder for the join entity type.
UsingEntity(string, Action<EntityTypeBuilder>)
Configures the join entity type implementing the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName, Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
joinEntityName
stringThe name of the join entity.
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.
UsingEntity(string, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft)
Parameters
joinEntityName
stringThe name of the join entity.
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
Returns
- EntityTypeBuilder
The builder for the join entity type.
UsingEntity(string, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Action<EntityTypeBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft, Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
joinEntityName
stringThe name of the join entity.
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.
UsingEntity(string, Type)
Configures the join entity type implementing the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName, Type joinEntityType)
Parameters
joinEntityName
stringThe name of the join entity.
joinEntityType
TypeThe CLR type of the join entity.
Returns
- EntityTypeBuilder
The builder for the join entity type.
UsingEntity(string, Type, Action<EntityTypeBuilder>)
Configures the join entity type implementing the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName, Type joinEntityType, Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
joinEntityName
stringThe name of the join entity.
joinEntityType
TypeThe CLR type of the join entity.
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.
UsingEntity(string, Type, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName, Type joinEntityType, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft)
Parameters
joinEntityName
stringThe name of the join entity.
joinEntityType
TypeThe CLR type of the join entity.
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
Returns
- EntityTypeBuilder
The builder for the join entity type.
UsingEntity(string, Type, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Action<EntityTypeBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(string joinEntityName, Type joinEntityType, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft, Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
joinEntityName
stringThe name of the join entity.
joinEntityType
TypeThe CLR type of the join entity.
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.
UsingEntity(string?, Type?, Func<IMutableEntityType, IMutableForeignKey>?, Func<IMutableEntityType, IMutableForeignKey>?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
[EntityFrameworkInternal]
protected virtual IMutableEntityType UsingEntity(string? joinEntityName, Type? joinEntityType, Func<IMutableEntityType, IMutableForeignKey>? configureRight, Func<IMutableEntityType, IMutableForeignKey>? configureLeft)
Parameters
joinEntityName
stringjoinEntityType
TypeconfigureRight
Func<IMutableEntityType, IMutableForeignKey>configureLeft
Func<IMutableEntityType, IMutableForeignKey>
Returns
UsingEntity(Type)
Configures the join entity type implementing the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(Type joinEntityType)
Parameters
joinEntityType
TypeThe CLR type of the join entity.
Returns
- EntityTypeBuilder
The builder for the join entity type.
UsingEntity(Type, Action<EntityTypeBuilder>)
Configures the join entity type implementing the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(Type joinEntityType, Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
joinEntityType
TypeThe CLR type of the join entity.
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.
UsingEntity(Type, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(Type joinEntityType, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft)
Parameters
joinEntityType
TypeThe CLR type of the join entity.
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
Returns
- EntityTypeBuilder
The builder for the join entity type.
UsingEntity(Type, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Func<EntityTypeBuilder, ReferenceCollectionBuilder>, Action<EntityTypeBuilder>)
Configures the relationships to the entity types participating in the many-to-many relationship.
public virtual EntityTypeBuilder UsingEntity(Type joinEntityType, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight, Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft, Action<EntityTypeBuilder> configureJoinEntityType)
Parameters
joinEntityType
TypeThe CLR type of the join entity.
configureRight
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the right entity type.
configureLeft
Func<EntityTypeBuilder, ReferenceCollectionBuilder>The configuration for the relationship to the left entity type.
configureJoinEntityType
Action<EntityTypeBuilder>The configuration of the join entity type.
Returns
- EntityTypeBuilder
The builder for the originating entity type so that multiple configuration calls can be chained.