IDbCommandInterceptor.ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, 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 'in çağrılması için yeterlidir ExecuteScalarAsync() .
public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object>> ScalarExecutingAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object>> ScalarExecutingAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> result, System.Threading.CancellationToken cancellationToken = default);
abstract member ScalarExecutingAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>>
abstract member ScalarExecutingAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>>
Public Function ScalarExecutingAsync (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Object), Optional cancellationToken As CancellationToken = Nothing) As Task(Of InterceptionResult(Of Object))
Public Function ScalarExecutingAsync (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Object), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult(Of Object))
Parametreler
- command
- DbCommand
Komut.
- eventData
- CommandEventData
Komut ve yürütme hakkında bağlamsal bilgiler.
- result
- InterceptionResult<Object>
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
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
İptal edilirse CancellationToken .