语言

DbConnectionDispatcher 类

定义

用于将操作调度到此类操作, DbConnection 以便在执行操作之前和之后通知任何 IDbConnectionInterceptor 已注册 DbInterception 的操作。 此类的实例通过 Dispatch Fluent API 获取。

public class DbConnectionDispatcher
type DbConnectionDispatcher = class
Public Class DbConnectionDispatcher
继承
DbConnectionDispatcher

注解

与 Entity Framework 交互 DbConnection时,此类在内部由 Entity Framework 使用。 它公开提供,以便运行在核心 EF 程序集外部的代码可以选择加入命令拦截/跟踪。 这通常是由代表 EF 执行的命令的 EF 提供程序完成的。

方法

名称 说明
BeginTransaction(DbConnection, BeginTransactionInterceptionContext)

在调用之前/之后发送BeginningTransaction(DbConnection, BeginTransactionInterceptionContext)并BeganTransaction(DbConnection, BeginTransactionInterceptionContext)发送到任何IDbConnectionInterceptor已注册DbInterception的 。BeginTransaction(IsolationLevel)

Close(DbConnection, DbInterceptionContext)

在调用之前/之后发送Closing(DbConnection, DbConnectionInterceptionContext)并Closed(DbConnection, DbConnectionInterceptionContext)发送到任何IDbConnectionInterceptor已注册DbInterception的 。Close()

Dispose(DbConnection, DbInterceptionContext)

在调用之前/之后发送Disposing(DbConnection, DbConnectionInterceptionContext)并Disposed(DbConnection, DbConnectionInterceptionContext)发送到任何IDbConnectionInterceptor已注册DbInterception的 。Dispose()

EnlistTransaction(DbConnection, EnlistTransactionInterceptionContext)

在调用之前/之后发送EnlistingTransaction(DbConnection, EnlistTransactionInterceptionContext)并EnlistedTransaction(DbConnection, EnlistTransactionInterceptionContext)发送到任何IDbConnectionInterceptor已注册DbInterception的 。EnlistTransaction(Transaction)

Equals(Object)

用于将操作调度到此类操作, DbConnection 以便在执行操作之前和之后通知任何 IDbConnectionInterceptor 已注册 DbInterception 的操作。 此类的实例通过 Dispatch Fluent API 获取。

GetConnectionString(DbConnection, DbInterceptionContext)

在获取ConnectionString之前/之后发送ConnectionStringGetting(DbConnection, DbConnectionInterceptionContext<String>)并ConnectionStringGot(DbConnection, DbConnectionInterceptionContext<String>)发送到任何IDbConnectionInterceptor已注册DbInterception的 。

GetConnectionTimeout(DbConnection, DbInterceptionContext)

在获取ConnectionTimeout之前/之后发送ConnectionTimeoutGetting(DbConnection, DbConnectionInterceptionContext<Int32>)并ConnectionTimeoutGot(DbConnection, DbConnectionInterceptionContext<Int32>)发送到任何IDbConnectionInterceptor已注册DbInterception的 。

GetDatabase(DbConnection, DbInterceptionContext)

在获取Database之前/之后发送DatabaseGetting(DbConnection, DbConnectionInterceptionContext<String>)并DatabaseGot(DbConnection, DbConnectionInterceptionContext<String>)发送到任何IDbConnectionInterceptor已注册DbInterception的 。

GetDataSource(DbConnection, DbInterceptionContext)

在获取DataSource之前/之后发送DataSourceGetting(DbConnection, DbConnectionInterceptionContext<String>)并DataSourceGot(DbConnection, DbConnectionInterceptionContext<String>)发送到任何IDbConnectionInterceptor已注册DbInterception的 。

GetHashCode()

用于将操作调度到此类操作, DbConnection 以便在执行操作之前和之后通知任何 IDbConnectionInterceptor 已注册 DbInterception 的操作。 此类的实例通过 Dispatch Fluent API 获取。

GetServerVersion(DbConnection, DbInterceptionContext)

在获取ServerVersion之前/之后发送ServerVersionGetting(DbConnection, DbConnectionInterceptionContext<String>)并ServerVersionGot(DbConnection, DbConnectionInterceptionContext<String>)发送到任何IDbConnectionInterceptor已注册DbInterception的 。

GetState(DbConnection, DbInterceptionContext)

在获取State之前/之后发送StateGetting(DbConnection, DbConnectionInterceptionContext<ConnectionState>)并StateGot(DbConnection, DbConnectionInterceptionContext<ConnectionState>)发送到任何IDbConnectionInterceptor已注册DbInterception的 。

GetType()

获取当前实例的 Type。

Open(DbConnection, DbInterceptionContext)

在调用之前/之后发送Opening(DbConnection, DbConnectionInterceptionContext)并Opened(DbConnection, DbConnectionInterceptionContext)发送到任何IDbConnectionInterceptor已注册DbInterception的 。Open()

OpenAsync(DbConnection, DbInterceptionContext, CancellationToken)

在调用之前/之后发送Opening(DbConnection, DbConnectionInterceptionContext)并Opened(DbConnection, DbConnectionInterceptionContext)发送到任何IDbConnectionInterceptor已注册DbInterception的 。Open()

SetConnectionString(DbConnection, DbConnectionPropertyInterceptionContext<String>)

在设置ConnectionString之前/之后发送ConnectionStringSetting(DbConnection, DbConnectionPropertyInterceptionContext<String>)并ConnectionStringSet(DbConnection, DbConnectionPropertyInterceptionContext<String>)发送到任何IDbConnectionInterceptor已注册DbInterception的 。

ToString()

用于将操作调度到此类操作, DbConnection 以便在执行操作之前和之后通知任何 IDbConnectionInterceptor 已注册 DbInterception 的操作。 此类的实例通过 Dispatch Fluent API 获取。

适用于