DbCommandInterceptor.ScalarExecuting 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ılmadan hemen önce çağrılır ExecuteScalar().
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> ScalarExecuting(System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> result);
abstract member ScalarExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>
override this.ScalarExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>
Public Overridable Function ScalarExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Object)) As InterceptionResult(Of Object)
Parametreler
- command
- DbCommand
Komutu.
- eventData
- CommandEventData
Komut ve yürütme hakkında bağlamsal bilgiler.
- result
- InterceptionResult<Object>
Varsa geçerli sonucu temsil eder.
Önceki bir kesme noktası tarafından çağrılarak trueSuppressWithResult(TResult)yürütme engellendiyse bu değer olarak ayarlanmış olacaktırHasResult.
Bu değer genellikle bu yöntemin uygulanması için dönüş değeri olarak kullanılır.
Döndürülenler
HasResult False ise EF normal şekilde devam eder.
HasResult True ise EF, gerçekleştirmek üzere olduğu işlemi gizler ve bunun yerine kullanırResult.
Sonucu değiştirmeye çalışmayan herhangi bir kesme noktası için bu yöntemin normal bir uygulaması, genellikle kullanarak geçirilen değeri döndürmektir resultFromResult<TResult>(TResult)