Table of Contents

Class CollectionNavigationBuilder

Namespace
Microsoft.EntityFrameworkCore.Metadata.Builders
Assembly
Microsoft.EntityFrameworkCore.dll

Provides a simple API for configuring a relationship where configuration began on an end of the relationship with a collection that contains instances of another entity type.

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.

public class CollectionNavigationBuilder : IInfrastructure<IConventionForeignKeyBuilder?>
Inheritance
CollectionNavigationBuilder
Implements
Derived
Inherited Members
Extension Methods

Remarks

See Modeling entity types and relationships for more information and examples.

Constructors

CollectionNavigationBuilder(IMutableEntityType, IMutableEntityType, MemberIdentity, IMutableForeignKey?, 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 CollectionNavigationBuilder(IMutableEntityType declaringEntityType, IMutableEntityType relatedEntityType, MemberIdentity navigation, IMutableForeignKey? foreignKey, IMutableSkipNavigation? skipNavigation)

Parameters

declaringEntityType IMutableEntityType
relatedEntityType IMutableEntityType
navigation MemberIdentity
foreignKey IMutableForeignKey
skipNavigation IMutableSkipNavigation

Properties

Builder

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 InternalForeignKeyBuilder? Builder { get; }

Property Value

InternalForeignKeyBuilder

CollectionMember

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 MemberInfo? CollectionMember { get; }

Property Value

MemberInfo

CollectionName

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 string? CollectionName { get; }

Property Value

string

DeclaringEntityType

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 DeclaringEntityType { get; }

Property Value

IMutableEntityType

RelatedEntityType

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 RelatedEntityType { get; }

Property Value

IMutableEntityType

Methods

WithLeftManyNavigation(MemberInfo)

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 IMutableSkipNavigation WithLeftManyNavigation(MemberInfo inverseMemberInfo)

Parameters

inverseMemberInfo MemberInfo

Returns

IMutableSkipNavigation

WithLeftManyNavigation(string?)

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 IMutableSkipNavigation WithLeftManyNavigation(string? inverseName)

Parameters

inverseName string

Returns

IMutableSkipNavigation

WithMany(string?)

Configures this as a many-to-many relationship.

public virtual CollectionCollectionBuilder WithMany(string? navigationName = null)

Parameters

navigationName string

The name of the collection navigation property on the other end of this relationship.

Returns

CollectionCollectionBuilder

An object to further configure the relationship.

WithOne(string?)

Configures this as a one-to-many relationship.

public virtual ReferenceCollectionBuilder WithOne(string? navigationName = null)

Parameters

navigationName string

The name of the reference navigation property on the other end of this relationship. If null or not specified, then there is no navigation property on the other end of the relationship.

Returns

ReferenceCollectionBuilder

An object to further 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.

WithOneBuilder(MemberInfo?)

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 InternalForeignKeyBuilder WithOneBuilder(MemberInfo? navigationMemberInfo)

Parameters

navigationMemberInfo MemberInfo

Returns

InternalForeignKeyBuilder

WithOneBuilder(string?)

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 InternalForeignKeyBuilder WithOneBuilder(string? navigationName)

Parameters

navigationName string

Returns

InternalForeignKeyBuilder

WithRightManyNavigation(MemberInfo, string?)

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 IMutableSkipNavigation WithRightManyNavigation(MemberInfo navigationMemberInfo, string? inverseName)

Parameters

navigationMemberInfo MemberInfo
inverseName string

Returns

IMutableSkipNavigation

WithRightManyNavigation(string?, string?)

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 IMutableSkipNavigation WithRightManyNavigation(string? navigationName, string? inverseName)

Parameters

navigationName string
inverseName string

Returns

IMutableSkipNavigation