Delen via


ReferenceReferenceBuilder Class

Definition

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

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

Remarks

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

Constructors

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

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

ReferenceReferenceBuilder(InternalForeignKeyBuilder, ReferenceReferenceBuilder, Boolean, 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.

ReferenceReferenceBuilder(InternalRelationshipBuilder, EntityType, EntityType)

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.

ReferenceReferenceBuilder(InternalRelationshipBuilder, ReferenceReferenceBuilder, Boolean, 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

Gets the internal builder being used to configure this relationship.

Builder

Gets the internal builder being used to configure this relationship.

(Inherited from ReferenceReferenceBuilderBase)
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 InvertibleRelationshipBuilderBase)
DeclaringEntityType

Gets the first entity type used to configure this relationship.

(Inherited from ReferenceReferenceBuilderBase)
DeclaringEntityType

Gets the first entity type used to configure this relationship.

(Inherited from InvertibleRelationshipBuilderBase)
Metadata

The foreign key that represents this relationship.

Metadata

The foreign key that represents this relationship.

(Inherited from ReferenceReferenceBuilderBase)
Metadata

The foreign key that represents this relationship.

(Inherited from InvertibleRelationshipBuilderBase)
RelatedEntityType

Gets the second entity type used to configure this relationship.

(Inherited from ReferenceReferenceBuilderBase)
RelatedEntityType

Gets the second entity type used to configure this relationship.

(Inherited from InvertibleRelationshipBuilderBase)

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, String[])

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

HasForeignKey(Type, String[])

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

HasForeignKey<TDependentEntity>(String[])

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

If the specified property name(s) do not exist on the entity type then a new shadow state property(s) will be added to serve as the foreign key. A shadow state property is one that does not have a corresponding property in the entity class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the entity class.

If HasPrincipalKey(Type, String[]) is not specified, then an attempt will be made to match the data type and order of foreign key properties against the primary key of the principal entity type. If they do not match, new shadow state properties that form a unique index will be added to the principal entity type to serve as the reference key.

HasForeignKeyBuilder(EntityType, String, 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(EntityType, String, 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(EntityType, String, 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, 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.

HasPrincipalKey(Type, 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.

HasPrincipalKey<TPrincipalEntity>(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(EntityType, String, 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(EntityType, String, 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(EntityType, String, 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.

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

ResolveEntityType(Type)

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.

SetDependentEntityType(String)

Sets the entity type that is the dependent of the relationship.

SetDependentEntityType(Type)

Sets the entity type that is the dependent of the relationship.

SetPrincipalEntityType(String)

Sets the entity type that is the principal of the relationship.

SetPrincipalEntityType(Type)

Sets the entity type that is the principal of the relationship.

Explicit Interface Implementations

IInfrastructure<IConventionForeignKeyBuilder>.Instance

Gets the value of the property being hidden.

(Inherited from InvertibleRelationshipBuilderBase)
IInfrastructure<IMutableModel>.Instance

The model that this relationship belongs to.

IInfrastructure<IMutableModel>.Instance

The model that this relationship belongs to.

(Inherited from ReferenceReferenceBuilderBase)
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 ReferenceReferenceBuilderBase)
IInfrastructure<InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

(Inherited from InvertibleRelationshipBuilderBase)

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(ReferenceReferenceBuilder, String)

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

HasConstraintName(ReferenceReferenceBuilder, String)

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

ForSqliteHasConstraintName(ReferenceReferenceBuilder, String)

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

ForSqlServerHasConstraintName(ReferenceReferenceBuilder, String)

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

Applies to