DbCommandInterceptor.ReaderExecuting Metoda

Definicja

Wywoływana 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 wartość true , jeśli jakiś poprzedni przechwytujący pominięto wykonywanie przez wywołanie metody SuppressWithResult(TResult). Ta wartość jest zwykle używana jako wartość zwracana dla implementacji tej metody.

Zwraca

InterceptionResult<DbDataReader>

Jeśli HasResult wartość ma wartość false, program EF będzie kontynuowany w normalny sposób. Jeśli HasResult wartość ma wartość true, program EF będzie pomijać operację, która miała wykonać i użyć zamiast tego Result . Normalna implementacja tej metody dla każdego przechwytnika, który nie próbuje zmienić wyniku, jest zwrócenie result wartości przekazanej, często przy użyciu FromResult<TResult>(TResult)

Implementuje

Dotyczy