DbCommandInterceptor.NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
EF çağrısı yapmak için hemen önce ExecuteNonQueryAsync() çağrılır.
public virtual 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 virtual 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>>
override this.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>>
override this.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 Overridable 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 Overridable 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>
Varsa geçerli sonucu temsil eder.
Bu değer, önceki HasResult bir kesme true noktası çağrılarak yürütmeyi bastırmışsa olarak SuppressWithResult(TResult) ayarlanmıştır.
Bu değer genellikle bu yöntemin uygulanması için dönüş değeri olarak kullanılır.
- cancellationToken
- CancellationToken
Görevin CancellationToken tamamlandıktan sonra gözlemlemek için bir.
Döndürülenler
false ise EF normal HasResult şekilde devam eder.
true HasResult ise EF, gerçekleştirmek üzere olduğu işlemi bastırarak bunun yerine Result kullanır.
Sonucu değiştirmeye çalışan herhangi bir kesme noktası için bu yöntemin normal bir uygulaması, geçirilen değeri genellikle kullanarak result geri dönmektir FromResult<TResult>(TResult)
Uygulamalar
Özel durumlar
iptal CancellationToken edilirse.