IDbCommandInterceptor.ScalarExecutedAsync メソッド

定義

EF が を呼び出した直後に呼び出されます ExecuteScalarAsync()

public System.Threading.Tasks.Task<object> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<object> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<object?> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object? result, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.ValueTask<object?> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object? result, System.Threading.CancellationToken cancellationToken = default);
abstract member ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
abstract member ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
abstract member ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
override this.ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
Public Function ScalarExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Object, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Public Function ScalarExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Object, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Object)
Public Overridable Function ScalarExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Object, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Object)

パラメーター

command
DbCommand

コマンド。

eventData
CommandExecutedEventData

コマンドと実行に関するコンテキスト情報。

result
Object

への ExecuteScalarAsync()呼び出しの結果。 この値は、通常、このメソッドの実装の戻り値として使用されます。

cancellationToken
CancellationToken

CancellationTokenタスクの完了を待機している間に観察する 。

戻り値

Task EF が使用する結果を提供する 。 結果を変更しようとしないインターセプターに対するこのメソッドの実装は、渡された値を result 返すことです。多くの場合、 FromResult<TResult>(TResult)

例外

CancellationToken が取り消されている場合。

注釈

インターセプターが で ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken)コマンドの実行を抑制した場合、このメソッドは引き続き呼び出されます。 この場合、 result は によって ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken)返される結果です。

適用対象