ReferenceReferenceBuilder<TEntity,TRelatedEntity> Class

Definition

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

public class ReferenceReferenceBuilder<TEntity,TRelatedEntity> : Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceReferenceBuilder where TEntity : class where TRelatedEntity : class
type ReferenceReferenceBuilder<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> = class
    inherit ReferenceReferenceBuilder
Public Class ReferenceReferenceBuilder(Of TEntity, TRelatedEntity)
Inherits ReferenceReferenceBuilder

Type Parameters

TEntity
TRelatedEntity
Inheritance
ReferenceReferenceBuilder<TEntity,TRelatedEntity>
Inheritance
ReferenceReferenceBuilder<TEntity,TRelatedEntity>
Inheritance
ReferenceReferenceBuilder<TEntity,TRelatedEntity>

Remarks

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

Constructors

ReferenceReferenceBuilder<TEntity,TRelatedEntity>(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<TEntity,TRelatedEntity>(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<TEntity,TRelatedEntity>(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<TEntity,TRelatedEntity>(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<TEntity,TRelatedEntity>(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.

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

(Inherited from ReferenceReferenceBuilder)
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>(Expression<Func<TDependentEntity,Object>>)

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.

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.

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

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

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

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

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.

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

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

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

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

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

(Inherited from ReferenceReferenceBuilder)
SetDependentEntityType(String)

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

(Inherited from ReferenceReferenceBuilder)
SetDependentEntityType(Type)

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

(Inherited from ReferenceReferenceBuilder)
SetPrincipalEntityType(String)

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

(Inherited from ReferenceReferenceBuilder)
SetPrincipalEntityType(Type)

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

(Inherited from ReferenceReferenceBuilder)

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.

(Inherited from ReferenceReferenceBuilder)
IInfrastructure<InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

(Inherited from ReferenceReferenceBuilder)

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<TEntity,TRelatedEntity>(ReferenceReferenceBuilder<TEntity,TRelatedEntity>, 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.

HasConstraintName<TEntity,TRelatedEntity>(ReferenceReferenceBuilder<TEntity,TRelatedEntity>, 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.

ForSqliteHasConstraintName<TEntity,TReferencedEntity>(ReferenceReferenceBuilder<TEntity,TReferencedEntity>, 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.

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

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

Applies to