IConventionForeignKeyBuilder.OnDelete 方法

定义

配置在删除主体或断开关系时应用于关系中依赖实体的操作。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder OnDelete (Microsoft.EntityFrameworkCore.DeleteBehavior? deleteBehavior, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? OnDelete (Microsoft.EntityFrameworkCore.DeleteBehavior? deleteBehavior, bool fromDataAnnotation = false);
abstract member OnDelete : Nullable<Microsoft.EntityFrameworkCore.DeleteBehavior> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function OnDelete (deleteBehavior As Nullable(Of DeleteBehavior), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

参数

deleteBehavior
Nullable<DeleteBehavior>

要执行的操作。 null 重置为默认值。

fromDataAnnotation
Boolean

指示是否使用数据注释指定配置。

返回

如果配置了删除操作,则为同一生成器实例, null 否则为 。

适用于