IDbCommandInterceptor 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
可以使用 DbInterception 注册实现此接口的对象,以在 Entity Framework 执行命令时接收通知。
public interface IDbCommandInterceptor : System.Data.Entity.Infrastructure.Interception.IDbInterceptor
type IDbCommandInterceptor = interface
interface IDbInterceptor
Public Interface IDbCommandInterceptor
Implements IDbInterceptor
- 派生
- 实现
注解
还可以在应用程序的配置文件中注册侦听器。 有关 Entity Framework 配置的详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=260883 。
方法
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() 或其一个异步对应项之前调用。 |
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈