Bagikan melalui


IDbCommandInterceptor.ReaderExecuting Metode

Definisi

Dipanggil tepat sebelum EF berniat untuk memanggil 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)

Parameter

command
DbCommand

Perintah.

eventData
CommandEventData

Informasi kontekstual tentang perintah dan eksekusi.

result
InterceptionResult<DbDataReader>

Mewakili hasil saat ini jika ada. Nilai ini akan diatur HasResult ke true jika beberapa pencegat sebelumnya menekan eksekusi dengan memanggil SuppressWithResult(TResult). Nilai ini biasanya digunakan sebagai nilai pengembalian untuk implementasi metode ini.

Mengembalikan

Jika HasResult false, EF akan berlanjut seperti biasa. Jika HasResult benar, maka EF akan menekan operasi yang akan dilakukan dan digunakan Result sebagai gantinya. Implementasi metode ini untuk setiap pencegat yang tidak mencoba mengubah hasilnya adalah mengembalikan nilai yang result diteruskan.

Berlaku untuk