IForeignKey IForeignKey Interface

Represents a relationship where a foreign key property(s) in a dependent entity type reference a corresponding primary or alternate key in a principal entity type.

Syntax

Declaration

public interface IForeignKey : IAnnotatablePublic Interface IForeignKey
    Inherits IAnnotatable

Inherited Members

Item[String],
Item(String),
FindAnnotation(String),
FindAnnotation(String),
GetAnnotations()
GetAnnotations()

Properties summary

Gets the dependent entity type. This may be different from the type that Properties are defined on when the relationship is defined a derived type in an inheritance hierarchy (since the properties may be defined on a base type).

Gets a value indicating how a delete operation is applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

Gets the navigation property on the dependent entity type that points to the principal entity.

Gets a value indicating if this relationship is required. If true, the dependent entity must always be assigned to a valid principal entity.

Gets a value indicating whether the values assigned to the foreign key properties are unique.

Gets the principal entity type that this relationship targets. This may be different from the type that

PrincipalKey is defined on when the relationship targets a derived type in an inheritance hierarchy (since the key is defined on the base type of the hierarchy).

Gets the primary or alternate key that the relationship targets.

Gets the navigation property on the principal entity type that points to the dependent entity.

Gets the foreign key properties in the dependent entity.

Properties

  • DeclaringEntityType
    DeclaringEntityType

    Gets the dependent entity type. This may be different from the type that Properties are defined on when the relationship is defined a derived type in an inheritance hierarchy (since the properties may be defined on a base type).

    IEntityType DeclaringEntityType { get; }ReadOnly Property DeclaringEntityType As IEntityType

    Property Value

  • DeleteBehavior
    DeleteBehavior

    Gets a value indicating how a delete operation is applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

    DeleteBehavior DeleteBehavior { get; }ReadOnly Property DeleteBehavior As DeleteBehavior

    Property Value

  • DependentToPrincipal
    DependentToPrincipal

    Gets the navigation property on the dependent entity type that points to the principal entity.

    INavigation DependentToPrincipal { get; }ReadOnly Property DependentToPrincipal As INavigation

    Property Value

  • IsRequired
    IsRequired

    Gets a value indicating if this relationship is required. If true, the dependent entity must always be assigned to a valid principal entity.

    bool IsRequired { get; }ReadOnly Property IsRequired As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • IsUnique
    IsUnique

    Gets a value indicating whether the values assigned to the foreign key properties are unique.

    bool IsUnique { get; }ReadOnly Property IsUnique As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • PrincipalEntityType
    PrincipalEntityType

    Gets the principal entity type that this relationship targets. This may be different from the type that

    PrincipalKey is defined on when the relationship targets a derived type in an inheritance hierarchy (since the key is defined on the base type of the hierarchy).

    IEntityType PrincipalEntityType { get; }ReadOnly Property PrincipalEntityType As IEntityType

    Property Value

  • PrincipalKey
    PrincipalKey

    Gets the primary or alternate key that the relationship targets.

    IKey PrincipalKey { get; }ReadOnly Property PrincipalKey As IKey

    Property Value

  • PrincipalToDependent
    PrincipalToDependent

    Gets the navigation property on the principal entity type that points to the dependent entity.

    INavigation PrincipalToDependent { get; }ReadOnly Property PrincipalToDependent As INavigation

    Property Value

  • Properties
    Properties

    Gets the foreign key properties in the dependent entity.

    IReadOnlyList<IProperty> Properties { get; }ReadOnly Property Properties As IReadOnlyList(Of IProperty)

    Property Value

    • System.Collections.Generic.IReadOnlyList<T><IProperty>
      System.Collections.Generic.IReadOnlyList<T>(Of IProperty)

Details

Assembly

Microsoft.EntityFrameworkCore.dll