Interface IForeignKeyConstraint
- Namespace
- Microsoft.EntityFrameworkCore.Metadata
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Represents a foreign key constraint.
public interface IForeignKeyConstraint : IAnnotatable, IReadOnlyAnnotatable
Remarks
See Modeling entity types and relationships for more information and examples.
Properties
Columns
Gets the columns that are participating in the foreign key constraint.
IReadOnlyList<IColumn> Columns { get; }
Property Value
MappedForeignKeys
Gets the mapped foreign keys.
IEnumerable<IForeignKey> MappedForeignKeys { get; }
Property Value
- IEnumerable<IForeignKey>
Name
Gets the name of the foreign key constraint.
string Name { get; }
Property Value
OnDeleteAction
Gets the action to be performed when the referenced row is deleted.
ReferentialAction OnDeleteAction { get; }
Property Value
PrincipalColumns
Gets the columns that are referenced by the foreign key constraint.
IReadOnlyList<IColumn> PrincipalColumns { get; }
Property Value
PrincipalTable
Gets the table that is referenced by the foreign key constraint.
ITable PrincipalTable { get; }
Property Value
PrincipalUniqueConstraint
Gets the unique constraint on the columns referenced by the foreign key constraint.
IUniqueConstraint PrincipalUniqueConstraint { get; }
Property Value
Table
Gets the table on with the foreign key constraint is declared.
ITable Table { get; }
Property Value
Methods
ToDebugString(MetadataDebugStringOptions, int)
Creates a human-readable representation of the given metadata.
Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.
string ToDebugString(MetadataDebugStringOptions options = 0, int indent = 0)
Parameters
optionsMetadataDebugStringOptionsOptions for generating the string.
indentintThe number of indent spaces to use before each new line.
Returns
- string
A human-readable representation.