語言

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 否則。

適用於