DbCommandInterceptor.ReaderExecuting Metoda

Definicja

Nazwana tuż przed tym, jak EF zamierza wywołać metodę ExecuteReader().

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>
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 Overridable Function ReaderExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of DbDataReader)) As InterceptionResult(Of DbDataReader)

Parametry

command
DbCommand

Polecenie.

eventData
CommandEventData

Kontekstowe informacje o poleceniu i wykonaniu.

result
InterceptionResult<DbDataReader>

Reprezentuje bieżący wynik, jeśli istnieje. Ta wartość będzie miała HasResult ustawioną wartość true , jeśli jakiś poprzedni przechwytujący pominął wykonywanie przez wywołanie metody SuppressWithResult(TResult). Ta wartość jest zwykle używana jako wartość zwracana dla implementacji tej metody.

Zwraca

Jeśli HasResult jest to fałsz, ef będzie nadal działać normalnie. Jeśli HasResult ma wartość true, program EF pominie operację, która miała wykonać i użyć Result . Normalna implementacja tej metody dla dowolnego przechwytywania, który nie próbuje zmienić wyniku, jest zwracanie przekazanej result wartości, często przy użyciu FromResult<TResult>(TResult)

Implementuje

Dotyczy