Aracılığıyla paylaş


IDbCommandInterceptor.ReaderExecuting Yöntem

Tanım

EF çağrısı yapmadan hemen önce çağrılır ExecuteReader().

public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader> ReaderExecuting (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader> result);
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader> ReaderExecuting (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader> result);
abstract member ReaderExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader>
abstract member ReaderExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader>
override this.ReaderExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbDataReader>
Public Function ReaderExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of DbDataReader)) As InterceptionResult(Of DbDataReader)
Public Overridable Function ReaderExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of DbDataReader)) As InterceptionResult(Of DbDataReader)

Parametreler

command
DbCommand

Komut.

eventData
CommandEventData

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

result
InterceptionResult<DbDataReader>

Varsa geçerli sonucu temsil eder. Önceki bir kesme noktası çağrısı SuppressWithResult(TResult)yaparak yürütmeyi engellediyse bu değer HasResult olarak ayarlanırtrue. Bu değer genellikle bu yöntemin uygulanması için dönüş değeri olarak kullanılır.

Döndürülenler

False HasResult ise EF normal şekilde devam eder. True HasResult ise, EF gerçekleştirmek üzere olduğu işlemi bastırır ve bunun yerine kullanır Result . Sonucu değiştirmeye çalışmayan herhangi bir kesme noktası için bu yöntemin bir uygulaması geçirilen değeri döndürmektir result .

Şunlara uygulanır