Share via


DbCommandDispatcher Class

Definition

Used for dispatching operations to a DbCommand such that any IDbCommandInterceptor registered on DbInterception will be notified before and after the operation executes. Instances of this class are obtained through the the Dispatch fluent API.

public class DbCommandDispatcher
type DbCommandDispatcher = class
Public Class DbCommandDispatcher
Inheritance
DbCommandDispatcher

Remarks

This class is used internally by Entity Framework when executing commands. It is provided publicly so that code that runs outside of the core EF assemblies can opt-in to command interception/tracing. This is typically done by EF providers that are executing commands on behalf of EF.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

GetType()

Gets the Type of the current instance.

NonQuery(DbCommand, DbCommandInterceptionContext)

Sends NonQueryExecuting(DbCommand, DbCommandInterceptionContext<Int32>) and NonQueryExecuted(DbCommand, DbCommandInterceptionContext<Int32>) to any IDbCommandInterceptor registered on DbInterception before/after making a call to ExecuteNonQuery().

NonQueryAsync(DbCommand, DbCommandInterceptionContext, CancellationToken)

Sends NonQueryExecuting(DbCommand, DbCommandInterceptionContext<Int32>) and NonQueryExecuted(DbCommand, DbCommandInterceptionContext<Int32>) to any IDbCommandInterceptor registered on DbInterception before/after making a call to ExecuteNonQueryAsync(CancellationToken).

Reader(DbCommand, DbCommandInterceptionContext)

Sends ReaderExecuting(DbCommand, DbCommandInterceptionContext<DbDataReader>) and ReaderExecuted(DbCommand, DbCommandInterceptionContext<DbDataReader>) to any IDbCommandInterceptor registered on DbInterception before/after making a call to ExecuteReader(CommandBehavior).

ReaderAsync(DbCommand, DbCommandInterceptionContext, CancellationToken)

Sends ReaderExecuting(DbCommand, DbCommandInterceptionContext<DbDataReader>) and ReaderExecuted(DbCommand, DbCommandInterceptionContext<DbDataReader>) to any IDbCommandInterceptor registered on DbInterception before/after making a call to ExecuteReaderAsync(CommandBehavior, CancellationToken).

Scalar(DbCommand, DbCommandInterceptionContext)

Sends ScalarExecuting(DbCommand, DbCommandInterceptionContext<Object>) and ScalarExecuted(DbCommand, DbCommandInterceptionContext<Object>) to any IDbCommandInterceptor registered on DbInterception before/after making a call to ExecuteScalar().

ScalarAsync(DbCommand, DbCommandInterceptionContext, CancellationToken)

Sends ScalarExecuting(DbCommand, DbCommandInterceptionContext<Object>) and ScalarExecuted(DbCommand, DbCommandInterceptionContext<Object>) to any IDbCommandInterceptor registered on DbInterception before/after making a call to ExecuteScalarAsync(CancellationToken).

ToString()

Returns a string that represents the current object.

Applies to