ReferenceReferenceBuilder ReferenceReferenceBuilder Class

Definition

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

If multiple reference key properties are specified, the order of reference key properties should match the order that the primary key or unique index properties were configured on the principal entity type.

public class ReferenceReferenceBuilder : IInfrastructure<IMutableModel>, IInfrastructure<InternalRelationshipBuilder>
Public Class ReferenceReferenceBuilder
    Implements IInfrastructure(Of IMutableModel), IInfrastructure(Of InternalRelationshipBuilder)
Inheritance
System.ObjectSystem.Object
ReferenceReferenceBuilderReferenceReferenceBuilder
Implements

Constructors

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

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 Builder

Gets the internal builder being used to configure this relationship.

Metadata Metadata

The foreign key that represents this relationship.

Methods

System.Object.Equals(System.Object) System.Object.Equals(System.Object) Inherited from System.Object
System.Object.Equals(System.Object, System.Object) System.Object.Equals(System.Object, System.Object) Inherited from System.Object
System.Object.GetHashCode() System.Object.GetHashCode() Inherited from System.Object
System.Object.GetType() System.Object.GetType() Inherited from System.Object
HasAnnotation(String, Object) HasAnnotation(String, Object)

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

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

HasForeignKey(Type, String[]) HasForeignKey(Type, 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.

HasForeignKey<TDependentEntity>(String[]) HasForeignKey(Of 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<PropertyInfo>) HasForeignKeyBuilder(EntityType, String, IReadOnlyList(Of 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>) HasForeignKeyBuilder(EntityType, String, IReadOnlyList(Of String))

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.

HasPrincipalKey(String, String[]) 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<TPrincipalEntity>(String[]) HasPrincipalKey(Of 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<PropertyInfo>) HasPrincipalKeyBuilder(EntityType, String, IReadOnlyList(Of 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>) HasPrincipalKeyBuilder(EntityType, String, IReadOnlyList(Of String))

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.

IsRequired(Boolean) IsRequired(Boolean)

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

OnDelete(DeleteBehavior) 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.

System.Object.ReferenceEquals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) Inherited from System.Object
ResolveEntityType(Type) ResolveEntityType(Type)

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.

System.Object.ToString() System.Object.ToString() Inherited from System.Object
HasPrincipalKey(Type, String[]) 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.

System.Object.MemberwiseClone() System.Object.MemberwiseClone() Inherited from System.Object
ResolveEntityType(String) ResolveEntityType(String)

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.

Explicit Interface Implementations

IInfrastructure<IMutableModel>.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.IMutableModel>.Instance

The model that this relationship belongs to.

IInfrastructure<InternalRelationshipBuilder>.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

Extension Methods

Microsoft.EntityFrameworkCore.SqlServerReferenceReferenceBuilderExtensions.ForSqlServerHasConstraintName(System.String) Microsoft.EntityFrameworkCore.SqlServerReferenceReferenceBuilderExtensions.ForSqlServerHasConstraintName(System.String)
Microsoft.EntityFrameworkCore.SqliteReferenceReferenceBuilderExtensions.ForSqliteHasConstraintName(System.String) Microsoft.EntityFrameworkCore.SqliteReferenceReferenceBuilderExtensions.ForSqliteHasConstraintName(System.String)
Microsoft.EntityFrameworkCore.RelationalReferenceReferenceBuilderExtensions.HasConstraintName(System.String) Microsoft.EntityFrameworkCore.RelationalReferenceReferenceBuilderExtensions.HasConstraintName(System.String)