共用方式為


DbCommandInterceptor.DataReaderDisposing 方法

定義

執行 即將處置 時 DbDataReader 呼叫。

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

參數

command
DbCommand

命令。

eventData
DataReaderDisposingEventData

命令和讀取器的相關內容資訊。

result
InterceptionResult

如果存在,則表示目前的結果。 如果某些先前的攔截器藉由呼叫 Suppress() 來隱藏執行,這個值將會 IsSuppressed 設定為 true 。 這個值通常用來做為這個方法實作的傳回值。

傳回

如果 IsSuppressed 為 false,EF 會如常繼續。 如果 IsSuppressed 為 true,EF 將會隱藏即將執行的作業。 任何未嘗試隱藏作業的攔截器,這個方法的一般實作就是傳回 result 傳入的值。

實作

適用於