共用方式為


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>)

在略過巡覽反向變更之後呼叫。

適用於