Aracılığıyla paylaş


IDbCommandInterceptor.ScalarExecutedAsync Yöntem

Tanım

EF çağrısı yaptıktan hemen sonra çağrılır 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)

Parametreler

command
DbCommand

Komut.

eventData
CommandExecutedEventData

Komut ve yürütme hakkında bağlamsal bilgiler.

result
Object

çağrısının ExecuteScalarAsync()sonucu. Bu değer genellikle bu yöntemin uygulanması için dönüş değeri olarak kullanılır.

cancellationToken
CancellationToken

CancellationToken Görevin tamamlanmasını beklerken gözlemlemek için bir.

Döndürülenler

Task EF'nin kullanacağı sonucu sağlayan. Sonucu değiştirmeye çalışmayan herhangi bir kesme noktası için bu yöntemin bir uygulaması, genellikle kullanarak geçirilen değeri döndürmektir resultFromResult<TResult>(TResult)

Özel durumlar

Açıklamalar

Bir kesme noktası içindeki bir komutun ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken)yürütülmesini engellediyse bu yöntem hala çağrılır. Bu durumda, result tarafından ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken)döndürülen sonuç olur.

Şunlara uygulanır