共用方式為


IDbCommandInterceptor.CommandFailed(DbCommand, CommandErrorEventData) 方法

定義

當命令執行失敗且發生例外狀況時呼叫。

public void CommandFailed (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData eventData);
public virtual void CommandFailed (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData eventData);
abstract member CommandFailed : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData -> unit
abstract member CommandFailed : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData -> unit
override this.CommandFailed : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData -> unit
Public Sub CommandFailed (command As DbCommand, eventData As CommandErrorEventData)
Public Overridable Sub CommandFailed (command As DbCommand, eventData As CommandErrorEventData)

參數

command
DbCommand

命令。

eventData
CommandErrorEventData

命令和執行的相關內容資訊。

適用於