共用方式為


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

指出是否已使用資料批註指定組態。

傳回

已設定的行為。

適用於