IDbCommandInterceptor.CommandFailedAsync Method

Definition

Called when execution of a command has failed with an exception.

C#
public System.Threading.Tasks.Task CommandFailedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData eventData, System.Threading.CancellationToken cancellationToken = default);
C#
public virtual System.Threading.Tasks.Task CommandFailedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData eventData, System.Threading.CancellationToken cancellationToken = default);

Parameters

command
DbCommand

The command.

eventData
CommandErrorEventData

Contextual information about the command and execution.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A Task representing the asynchronous operation.

Exceptions

Applies to

Toode Versioonid
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0