SqlServerOnDeleteConvention 类

定义

为联接实体类型上的外键配置 OnDelete 行为的约定,用于自引用跳过导航

public class SqlServerOnDeleteConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.CascadeDeleteConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention
public class SqlServerOnDeleteConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.CascadeDeleteConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention
type SqlServerOnDeleteConvention = class
    inherit CascadeDeleteConvention
    interface ISkipNavigationForeignKeyChangedConvention
    interface IConvention
type SqlServerOnDeleteConvention = class
    inherit CascadeDeleteConvention
    interface ISkipNavigationForeignKeyChangedConvention
    interface IConvention
    interface IEntityTypeAnnotationChangedConvention
Public Class SqlServerOnDeleteConvention
Inherits CascadeDeleteConvention
Implements ISkipNavigationForeignKeyChangedConvention
Public Class SqlServerOnDeleteConvention
Inherits CascadeDeleteConvention
Implements IEntityTypeAnnotationChangedConvention, ISkipNavigationForeignKeyChangedConvention
继承
SqlServerOnDeleteConvention
实现

注解

有关详细信息和示例,请参阅模型构建约定和使用 EF Core 访问SQL Server和Azure SQL数据库

构造函数

SqlServerOnDeleteConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

创建 SqlServerOnDeleteConvention 的新实例。

属性

Dependencies

此服务的依赖项。

(继承自 CascadeDeleteConvention)
RelationalDependencies

此服务的关系提供程序特定的依赖项。

方法

GetTargetDeleteBehavior(IConventionForeignKey)

返回要为给定外键设置的删除行为。

ProcessEntityTypeAnnotationChanged(IConventionEntityTypeBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

在实体类型上更改批注后调用。

ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

在将外键添加到实体类型后调用。

(继承自 CascadeDeleteConvention)
ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

在将外键添加到实体类型后调用。

(继承自 CascadeDeleteConvention)
ProcessForeignKeyRequirednessChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

更改外键的必需项后调用。

(继承自 CascadeDeleteConvention)
ProcessForeignKeyRequirednessChanged(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

更改外键的必需项后调用。

(继承自 CascadeDeleteConvention)
ProcessSkipNavigationForeignKeyChanged(IConventionSkipNavigationBuilder, IConventionForeignKey, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

在跳过导航逆向更改后调用。

适用于