Udostępnij za pośrednictwem


ReferenceCollectionBuilder Class

Definition

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

public class ReferenceCollectionBuilder : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.IMutableModel>, Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalRelationshipBuilder>
public class ReferenceCollectionBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilderBase
public class ReferenceCollectionBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.RelationshipBuilderBase
type ReferenceCollectionBuilder = class
    interface IInfrastructure<IMutableModel>
    interface IInfrastructure<InternalRelationshipBuilder>
type ReferenceCollectionBuilder = class
    inherit ReferenceCollectionBuilderBase
type ReferenceCollectionBuilder = class
    inherit RelationshipBuilderBase
Public Class ReferenceCollectionBuilder
Implements IInfrastructure(Of IMutableModel), IInfrastructure(Of InternalRelationshipBuilder)
Public Class ReferenceCollectionBuilder
Inherits ReferenceCollectionBuilderBase
Public Class ReferenceCollectionBuilder
Inherits RelationshipBuilderBase
Inheritance
ReferenceCollectionBuilder
Inheritance
ReferenceCollectionBuilder
Inheritance
ReferenceCollectionBuilder
Derived
Implements
IInfrastructure<IMutableModel> IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalRelationshipBuilder>

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

ReferenceCollectionBuilder(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.

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.

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 ReferenceCollectionBuilderBase)
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.

(Inherited from RelationshipBuilderBase)
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.

Metadata

The foreign key that represents this relationship.

(Inherited from ReferenceCollectionBuilderBase)
Metadata

The foreign key that represents this relationship.

(Inherited from RelationshipBuilderBase)
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(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.

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.

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.

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.

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.

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.

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.

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.

IInfrastructure<IMutableModel>.Instance

The model that this relationship belongs to.

(Inherited from ReferenceCollectionBuilderBase)
IInfrastructure<InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

IInfrastructure<InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

(Inherited from ReferenceCollectionBuilderBase)
IInfrastructure<InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

(Inherited from RelationshipBuilderBase)

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

ForSqlServerHasConstraintName(ReferenceCollectionBuilder, String)

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

Applies to