Share via


ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity> Class

Definition

Provides a simple API for configuring a one-to-many relationship.

public class ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity> : Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder where TPrincipalEntity : class where TDependentEntity : class
type ReferenceCollectionBuilder<'PrincipalEntity, 'DependentEntity (requires 'PrincipalEntity : null and 'DependentEntity : null)> = class
    inherit ReferenceCollectionBuilder
Public Class ReferenceCollectionBuilder(Of TPrincipalEntity, TDependentEntity)
Inherits ReferenceCollectionBuilder

Type Parameters

TPrincipalEntity

The principal entity type in this relationship.

TDependentEntity

The dependent entity type in this relationship.

Inheritance
ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>
Inheritance
ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>
Inheritance
ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>

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

ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>(EntityType, EntityType, InternalRelationshipBuilder)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>(IMutableEntityType, 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.

ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>(InternalForeignKeyBuilder, ReferenceCollectionBuilder, Boolean, Boolean, Boolean)

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.

ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>(InternalRelationshipBuilder)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>(InternalRelationshipBuilder, ReferenceCollectionBuilder, Boolean, Boolean, Boolean)

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.

Properties

Builder

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ReferenceCollectionBuilder)
DependentEntityType

Gets the dependent entity type used to configure this relationship.

(Inherited from ReferenceCollectionBuilderBase)
DependentEntityType

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.

(Inherited from RelationshipBuilderBase)
Metadata

The foreign key that represents this relationship.

(Inherited from ReferenceCollectionBuilder)
PrincipalEntityType

Gets the principal entity type used to configure this relationship.

(Inherited from ReferenceCollectionBuilderBase)
PrincipalEntityType

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.

(Inherited from RelationshipBuilderBase)

Methods

HasAnnotation(String, Object)

Adds or updates an annotation on the relationship. If an annotation with the key specified in annotation already exists its value will be updated.

HasForeignKey(Expression<Func<TDependentEntity,Object>>)

Configures the property(s) to use as the foreign key for this relationship.

HasForeignKey(String[])

Configures the property(s) to use as the foreign key for this relationship.

HasForeignKeyBuilder(IReadOnlyList<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.

(Inherited from ReferenceCollectionBuilder)
HasForeignKeyBuilder(IReadOnlyList<PropertyInfo>)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ReferenceCollectionBuilder)
HasForeignKeyBuilder(IReadOnlyList<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.

(Inherited from ReferenceCollectionBuilder)
HasPrincipalKey(Expression<Func<TPrincipalEntity,Object>>)

Configures the unique property(s) that this relationship targets. Typically you would only call this method if you want to use a property(s) other than the primary key as the principal property(s). If the specified property(s) is not already a unique constraint (or the primary key) then a new unique constraint will be introduced.

HasPrincipalKey(String[])

Configures the unique property(s) that this relationship targets. Typically you would only call this method if you want to use a property(s) other than the primary key as the principal property(s). If the specified property(s) is not already a unique constraint (or the primary key) then a new unique constraint will be introduced.

HasPrincipalKeyBuilder(IReadOnlyList<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.

(Inherited from ReferenceCollectionBuilder)
HasPrincipalKeyBuilder(IReadOnlyList<PropertyInfo>)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ReferenceCollectionBuilder)
HasPrincipalKeyBuilder(IReadOnlyList<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.

(Inherited from ReferenceCollectionBuilder)
IsRequired(Boolean)

Configures whether this is a required relationship (i.e. whether the foreign key property(s) can be assigned null).

OnDelete(DeleteBehavior)

Configures the operation applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

OnDelete(DeleteBehavior)

Configures how a delete operation is applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

OnDelete(DeleteBehavior)

Configures the operation applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

(Inherited from ReferenceCollectionBuilder)
OnDelete(DeleteBehavior)

Configures how a delete operation is applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

(Inherited from ReferenceCollectionBuilder)

Explicit Interface Implementations

IInfrastructure<IConventionForeignKeyBuilder>.Instance

Gets the internal builder being used to configure this relationship.

(Inherited from RelationshipBuilderBase)
IInfrastructure<IMutableModel>.Instance

The model that this relationship belongs to.

(Inherited from ReferenceCollectionBuilder)
IInfrastructure<InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

(Inherited from ReferenceCollectionBuilder)

Extension Methods

GetInfrastructure<T>(IInfrastructure<T>)

Gets the value from a property that is being hidden using IInfrastructure<T>.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

HasConstraintName(ReferenceCollectionBuilder, String)

Configures the foreign key constraint name for this relationship when targeting a relational database.

HasConstraintName<TEntity,TRelatedEntity>(ReferenceCollectionBuilder<TEntity,TRelatedEntity>, String)

Configures the foreign key constraint name for this relationship when targeting a relational database.

HasConstraintName(ReferenceCollectionBuilder, String)

Configures the foreign key constraint name for this relationship when targeting a relational database.

HasConstraintName<TEntity,TRelatedEntity>(ReferenceCollectionBuilder<TEntity,TRelatedEntity>, String)

Configures the foreign key constraint name for this relationship when targeting a relational database.

ForSqliteHasConstraintName(ReferenceCollectionBuilder, String)

Configures the foreign key constraint name for this relationship when targeting SQLite.

ForSqliteHasConstraintName<TEntity,TReferencedEntity>(ReferenceCollectionBuilder<TEntity,TReferencedEntity>, String)

Configures the foreign key constraint name for this relationship when targeting SQLite.

ForSqlServerHasConstraintName(ReferenceCollectionBuilder, String)

Configures the foreign key constraint name for this relationship when targeting SQL Server.

ForSqlServerHasConstraintName<TEntity,TRelatedEntity>(ReferenceCollectionBuilder<TEntity,TRelatedEntity>, String)

Configures the foreign key constraint name for this relationship when targeting SQL Server.

Applies to