IConventionForeignKey.SetDeleteBehavior 方法

定义

设置一个值,该值指示在删除主体或断开关系时如何将删除操作应用于关系中的依赖实体。

public void SetDeleteBehavior (Microsoft.EntityFrameworkCore.DeleteBehavior? deleteBehavior, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.DeleteBehavior? SetDeleteBehavior (Microsoft.EntityFrameworkCore.DeleteBehavior? deleteBehavior, bool fromDataAnnotation = false);
abstract member SetDeleteBehavior : Nullable<Microsoft.EntityFrameworkCore.DeleteBehavior> * bool -> unit
abstract member SetDeleteBehavior : Nullable<Microsoft.EntityFrameworkCore.DeleteBehavior> * bool -> Nullable<Microsoft.EntityFrameworkCore.DeleteBehavior>
Public Sub SetDeleteBehavior (deleteBehavior As Nullable(Of DeleteBehavior), Optional fromDataAnnotation As Boolean = false)
Public Function SetDeleteBehavior (deleteBehavior As Nullable(Of DeleteBehavior), Optional fromDataAnnotation As Boolean = false) As Nullable(Of DeleteBehavior)

参数

deleteBehavior
Nullable<DeleteBehavior>

一个 值,该值指示删除主体或断开关系时如何将删除操作应用于关系中的依赖实体。

fromDataAnnotation
Boolean

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

返回

配置的行为。

适用于