IDbCommandInterceptor 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
實作此介面的物件可註冊 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() 其非同步對應節點之前被呼叫。 |