Share via


IForeignKeyConstraint 接口

定义

表示外键约束。

public interface IForeignKeyConstraint : Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable
type IForeignKeyConstraint = interface
    interface IAnnotatable
type IForeignKeyConstraint = interface
    interface IAnnotatable
    interface IReadOnlyAnnotatable
Public Interface IForeignKeyConstraint
Implements IAnnotatable
实现

注解

有关详细信息和示例,请参阅 为实体类型和关系建模

属性

Columns

获取参与外键约束的列。

Item[String]

获取具有给定名称的批注的值,如果不存在,则返回 null

(继承自 IReadOnlyAnnotatable)
MappedForeignKeys

获取映射的外键。

Name

获取外键约束的名称。

OnDeleteAction

获取删除引用的行时要执行的操作。

PrincipalColumns

获取由外键约束引用的列。

PrincipalTable

获取由外键约束引用的表。

PrincipalUniqueConstraint

获取外键约束所引用列的唯一约束。

Table

获取声明了外键约束的 表。

方法

AddRuntimeAnnotation(String, Object)

向此对象添加运行时批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 IAnnotatable)
AnnotationsToDebugString(Int32)

获取对象上声明的所有注释的调试字符串。

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则返回 null

(继承自 IReadOnlyAnnotatable)
FindRuntimeAnnotation(String)

获取具有给定名称的运行时注释,如果不存在,则返回 null

(继承自 IAnnotatable)
FindRuntimeAnnotationValue(String)

获取具有给定名称的运行时注释的值,如果不存在,则返回 null

(继承自 IAnnotatable)
GetAnnotation(String)

获取具有给定名称的批注,如果不存在,则引发该批注。

(继承自 IReadOnlyAnnotatable)
GetAnnotations()

获取当前 对象上的所有注释。

(继承自 IReadOnlyAnnotatable)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

获取具有给定名称的运行时注释的值,如果不存在,则添加该值。

(继承自 IAnnotatable)
GetRuntimeAnnotations()

获取当前 对象上的所有运行时注释。

(继承自 IAnnotatable)
RemoveRuntimeAnnotation(String)

从此 对象中删除给定的运行时批注。

(继承自 IAnnotatable)
SetRuntimeAnnotation(String, Object)

设置存储在给定键下的运行时注释。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 IAnnotatable)
ToDebugString(MetadataDebugStringOptions, Int32)

创建给定元数据的可读表示形式。

警告:不要依赖于返回的字符串的格式。 它仅用于调试,并且可能会在版本之间任意更改。

扩展方法

AnnotationsToDebugString(IAnnotatable, Int32)

获取对象上声明的所有注释的调试字符串。

GetAnnotation(IAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

ToDebugString(IForeignKeyConstraint, MetadataDebugStringOptions, Int32)

创建给定元数据的可读表示形式。

警告:不要依赖于返回的字符串的格式。 它仅用于调试,并且可能会在版本之间任意更改。

适用于