IConventionForeignKey.SetDeleteBehavior Method

Definition

Sets a value indicating how a delete operation is applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

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)

Parameters

deleteBehavior
Nullable<DeleteBehavior>

A value indicating how a delete operation is applied to dependent entities in the relationship when the principal is deleted or the relationship is severed.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured behavior.

Applies to