語言

IDbCommandInterceptor 介面

定義

實作此介面的物件可註冊 DbInterception 以接收 Entity Framework 執行指令時的通知。

public interface IDbCommandInterceptor : System.Data.Entity.Infrastructure.Interception.IDbInterceptor
type IDbCommandInterceptor = interface
    interface IDbInterceptor
Public Interface IDbCommandInterceptor
Implements IDbInterceptor
衍生
實作

備註

攔截器也可以註冊在應用程式的設定檔中。 請參閱 http://go.microsoft.com/fwlink/?LinkId=260883 更多關於實體框架設定的資訊。

方法

名稱 Description
NonQueryExecuted(DbCommand, DbCommandInterceptionContext<Int32>)

此方法在呼叫 或 ExecuteNonQuery() 其非同步對應節點後被呼叫。 實體框架所使用的結果可透過設定 Result來更改。

NonQueryExecuting(DbCommand, DbCommandInterceptionContext<Int32>)

此方法會在呼叫 或 ExecuteNonQuery() 其非同步對應節點之前被呼叫。

ReaderExecuted(DbCommand, DbCommandInterceptionContext<DbDataReader>)

此方法在呼叫 或 ExecuteReader(CommandBehavior) 其非同步對應節點後被呼叫。 實體框架所使用的結果可透過設定 Result來更改。

ReaderExecuting(DbCommand, DbCommandInterceptionContext<DbDataReader>)

此方法會在呼叫 或 ExecuteReader(CommandBehavior) 其非同步對應節點之前被呼叫。

ScalarExecuted(DbCommand, DbCommandInterceptionContext<Object>)

此方法在呼叫 或 ExecuteScalar() 其非同步對應節點後被呼叫。 實體框架所使用的結果可透過設定 Result來更改。

ScalarExecuting(DbCommand, DbCommandInterceptionContext<Object>)

此方法會在呼叫 或 ExecuteScalar() 其非同步對應節點之前被呼叫。

適用於