IConventionForeignKeyBuilder Interface

Definition

Provides a simple API surface for configuring an IConventionForeignKey from conventions.

This interface is typically used by database providers (and other extensions). It is generally not used in application code.

public interface IConventionForeignKeyBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
type IConventionForeignKeyBuilder = interface
    interface IConventionAnnotatableBuilder
Public Interface IConventionForeignKeyBuilder
Implements IConventionAnnotatableBuilder
Implements

Remarks

See Model building conventions for more information and examples.

Properties

Metadata

Gets the foreign key being configured.

ModelBuilder

Gets the model builder.

(Inherited from IConventionAnnotatableBuilder)

Methods

CanInvert(IReadOnlyList<IConventionProperty>, Boolean)

Returns a value indicating whether the principal and dependent entity types can be switched from the current configuration source

CanRemoveAnnotation(String, Boolean)

Returns a value indicating whether an annotation with the given name can be removed using this configuration source.

(Inherited from IConventionAnnotatableBuilder)
CanSetAnnotation(String, Object, Boolean)

Returns a value indicating whether an annotation with the given name and value can be set from this configuration source.

(Inherited from IConventionAnnotatableBuilder)
CanSetEntityTypes(IConventionEntityType, IConventionEntityType, Boolean)

Returns a value indicating whether the principal and dependent types can be switched or the relationship could be moved to a base type of one of the participating entity types.

CanSetForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

Returns a value indicating whether the given properties can be set as the foreign key for this relationship from the current configuration source.

CanSetForeignKey(IReadOnlyList<String>, Boolean)

Returns a value indicating whether the given properties can be set as the foreign key for this relationship from the current configuration source.

CanSetIsOwnership(Nullable<Boolean>, Boolean)

Returns a value indicating whether this relationship can be configured as defining an ownership or not from the current configuration source.

CanSetIsRequired(Nullable<Boolean>, Boolean)

Returns a value indicating whether the relationship requiredness can be configured from the current configuration source.

CanSetIsRequiredDependent(Nullable<Boolean>, Boolean)

Returns a value indicating whether the dependent end requiredness can be configured from the current configuration source.

CanSetIsUnique(Nullable<Boolean>, Boolean)

Returns a value indicating whether this relationship uniqueness can be configured from the current configuration source.

CanSetNavigation(MemberInfo, Boolean, Boolean)

Returns a value indicating whether the given property can be used as a navigation for this relationship from the current configuration source.

CanSetNavigation(String, Boolean, Boolean)

Returns a value indicating whether the property with the given name can be used as a navigation for this relationship from the current configuration source.

CanSetNavigations(MemberInfo, MemberInfo, Boolean)

Returns a value indicating whether the given properties can be used as the navigation properties for this relationship from the current configuration source

CanSetNavigations(String, String, Boolean)

Returns a value indicating whether the properties with the given names can be used as the navigation properties for this relationship from the current configuration source

CanSetOnDelete(Nullable<DeleteBehavior>, Boolean)

Returns a value indicating whether the operation on principal deletion can be configured from the current configuration source.

CanSetPrincipalKey(IReadOnlyList<IConventionProperty>, Boolean)

Returns a value indicating whether the given properties can be set as the target for this relationship from the current configuration source

CanSetPrincipalKey(IReadOnlyList<String>, Boolean)

Returns a value indicating whether the given properties can be set as the target for this relationship from the current configuration source

HasAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists with same or lower ConfigurationSource.

HasEntityTypes(IConventionEntityType, IConventionEntityType, Boolean)

Configures which entity types participate in this relationship. By calling this method the principal and dependent types can be switched or the relationship could be moved to a base type of one of the participating entity types.

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

Configures the properties to use as the foreign key for this relationship.

HasForeignKey(IReadOnlyList<String>, Boolean)

Configures the properties to use as the foreign key for this relationship.

HasNavigation(MemberInfo, Boolean, Boolean)

Configures the given property as a navigation property used by this relationship.

HasNavigation(String, Boolean, Boolean)

Configures the property with the given name as a navigation property used by this relationship.

HasNavigations(MemberInfo, MemberInfo, Boolean)

Configures the given properties as the navigation properties used by this relationship.

HasNavigations(String, String, Boolean)

Configures the properties with the given names as the navigation properties used by this relationship.

HasNoAnnotation(String, Boolean)

Removes the annotation with the given name from this object.

HasNonNullAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists with same or lower ConfigurationSource. Removes the annotation if null value is specified.

HasPrincipalKey(IReadOnlyList<IConventionProperty>, Boolean)

Configures the properties that this relationship targets.

HasPrincipalKey(IReadOnlyList<String>, Boolean)

Configures the properties that this relationship targets.

IsOwnership(Nullable<Boolean>, Boolean)

Configures whether this relationship defines an ownership (i.e. whether the dependent entity must always be accessed via the navigation from the principal entity).

IsRequired(Nullable<Boolean>, Boolean)

Configures whether this is a required relationship (i.e. whether none of the foreign key properties can be assigned null).

IsRequiredDependent(Nullable<Boolean>, Boolean)

Configures whether the dependent end is required (i.e. whether the principal to dependent navigation can be assigned null).

IsUnique(Nullable<Boolean>, Boolean)

Configures whether the dependent entity is unique (i.e. whether the navigation to the dependent entity type is not a collection).

OnDelete(Nullable<DeleteBehavior>, Boolean)

Configures the operation applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

RemoveAnnotation(String, Boolean)
Obsolete.

Removes the annotation with the given name from this object.

(Inherited from IConventionAnnotatableBuilder)
SetOrRemoveAnnotation(String, Object, Boolean)
Obsolete.

Sets or removes the annotation stored under the given name.

(Inherited from IConventionAnnotatableBuilder)

Extension Methods

CanSetConstraintName(IConventionForeignKeyBuilder, String, Boolean)

Returns a value indicating whether the foreign key constraint name can be set for this relationship from the current configuration source

HasConstraintName(IConventionForeignKeyBuilder, String, Boolean)

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

Applies to