ReferenceReferenceBuilder<TEntity, TRelatedEntity> ReferenceReferenceBuilder(Of TEntity, TRelatedEntity) 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<TEntity, TRelatedEntity> : ReferenceReferenceBuilder, IInfrastructure<IMutableModel>, IInfrastructure<InternalRelationshipBuilder> where TEntity : class where TRelatedEntity : class
Public Class ReferenceReferenceBuilder(Of TEntity As Class, TRelatedEntity As Class)
    Inherits ReferenceReferenceBuilder
    Implements IInfrastructure(Of IMutableModel), IInfrastructure(Of InternalRelationshipBuilder)

Type Parameters

TEntity
TRelatedEntity
Inheritance
System.ObjectSystem.Object
ReferenceReferenceBuilder<TEntity, TRelatedEntity>ReferenceReferenceBuilder(Of TEntity, TRelatedEntity)
Implements

Constructors

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

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>(Expression<Func<TDependentEntity, Object>>) HasForeignKey(Of TDependentEntity)(Expression(Of Func(Of TDependentEntity, Object)))

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

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

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.

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

(Inherited from ReferenceReferenceBuilder)
HasPrincipalKey<TPrincipalEntity>(Expression<Func<TPrincipalEntity, Object>>) HasPrincipalKey(Of TPrincipalEntity)(Expression(Of Func(Of 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[]) 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.

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

(Inherited from ReferenceReferenceBuilder)
IsRequired(Boolean) IsRequired(Boolean)

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

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.

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

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

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.

System.Object.MemberwiseClone() System.Object.MemberwiseClone() Inherited from System.Object
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

Properties

Builder Builder

Gets the internal builder being used to configure this relationship.

(Inherited from ReferenceReferenceBuilder)
IInfrastructure<IMutableModel>.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.IMutableModel>.Instance

The model that this relationship belongs to.

(Inherited from ReferenceReferenceBuilder)
IInfrastructure<InternalRelationshipBuilder>.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalRelationshipBuilder>.Instance

Gets the internal builder being used to configure this relationship.

(Inherited from ReferenceReferenceBuilder)
Metadata Metadata

The foreign key that represents this relationship.

(Inherited from ReferenceReferenceBuilder)

Extension Methods

Microsoft.EntityFrameworkCore.SqlServerReferenceReferenceBuilderExtensions.ForSqlServerHasConstraintName(System.String) Microsoft.EntityFrameworkCore.SqlServerReferenceReferenceBuilderExtensions.ForSqlServerHasConstraintName(System.String)
Microsoft.EntityFrameworkCore.SqlServerReferenceReferenceBuilderExtensions.ForSqlServerHasConstraintName<TEntity, TRelatedEntity>(System.String) Microsoft.EntityFrameworkCore.SqlServerReferenceReferenceBuilderExtensions.ForSqlServerHasConstraintName(Of TEntity, TRelatedEntity)(System.String)
Microsoft.EntityFrameworkCore.SqliteReferenceReferenceBuilderExtensions.ForSqliteHasConstraintName(System.String) Microsoft.EntityFrameworkCore.SqliteReferenceReferenceBuilderExtensions.ForSqliteHasConstraintName(System.String)
Microsoft.EntityFrameworkCore.SqliteReferenceReferenceBuilderExtensions.ForSqliteHasConstraintName<TEntity, TRelatedEntity>(System.String) Microsoft.EntityFrameworkCore.SqliteReferenceReferenceBuilderExtensions.ForSqliteHasConstraintName(Of TEntity, TRelatedEntity)(System.String)
Microsoft.EntityFrameworkCore.RelationalReferenceReferenceBuilderExtensions.HasConstraintName(System.String) Microsoft.EntityFrameworkCore.RelationalReferenceReferenceBuilderExtensions.HasConstraintName(System.String)
Microsoft.EntityFrameworkCore.RelationalReferenceReferenceBuilderExtensions.HasConstraintName<TEntity, TRelatedEntity>(System.String) Microsoft.EntityFrameworkCore.RelationalReferenceReferenceBuilderExtensions.HasConstraintName(Of TEntity, TRelatedEntity)(System.String)