IDbCommandInterceptor.NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken) Yöntem

Tanım

EF 'in çağrılması için yeterlidir ExecuteNonQueryAsync() .

public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>> NonQueryExecutingAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>> NonQueryExecutingAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result, System.Threading.CancellationToken cancellationToken = default);
abstract member NonQueryExecutingAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>>
abstract member NonQueryExecutingAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>>
Public Function NonQueryExecutingAsync (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Integer), Optional cancellationToken As CancellationToken = Nothing) As Task(Of InterceptionResult(Of Integer))
Public Function NonQueryExecutingAsync (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Integer), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult(Of Integer))

Parametreler

command
DbCommand

Komut.

eventData
CommandEventData

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

result
InterceptionResult<Int32>

Bir varsa geçerli sonucu temsil eder. Bu değer, HasResult true bazı önceki bir yakalayıcıyı çağırarak yürütülecektir olarak ayarlanır SuppressWithResult(TResult) . Bu değer genellikle bu yöntemin uygulanması için dönüş değeri olarak kullanılır.

cancellationToken
CancellationToken

CancellationTokenGörevin tamamlanması beklenirken gözlemlenemedi.

Döndürülenler

Task<InterceptionResult<Int32>>
ValueTask<InterceptionResult<Int32>>

HasResultYanlış ise, EF normal olarak devam eder. HasResultTrue Ise EF, yerine getirmek ve kullanmak üzere olduğu işlemi bastırır Result . Bu yöntemin, sonucu değiştirmeye çalışan her bir şifre için normal bir uygulama, result genellikle FromResult<TResult>(TResult)

Özel durumlar

Şunlara uygulanır