Share via


IDbTransactionInterceptor Interface

Definition

Allows interception of operations related to a DbTransaction.

public interface IDbTransactionInterceptor : Microsoft.EntityFrameworkCore.Diagnostics.IInterceptor
type IDbTransactionInterceptor = interface
    interface IInterceptor
Public Interface IDbTransactionInterceptor
Implements IInterceptor
Derived
Implements

Remarks

Transaction interceptors can be used to view, change, or suppress operations on DbTransaction, and to modify the result before it is returned to EF.

Consider inheriting from DbTransactionInterceptor if not implementing all methods.

Use AddInterceptors(IInterceptor[]) to register application interceptors.

Extensions can also register interceptors in the internal service provider. If both injected and application interceptors are found, then the injected interceptors are run in the order that they are resolved from the service provider, and then the application interceptors are run last.

See EF Core interceptors for more information and examples.

Methods

CreatedSavepoint(DbTransaction, TransactionEventData)

Called immediately after EF creates a transaction savepoint.

CreatedSavepointAsync(DbTransaction, TransactionEventData, CancellationToken)

Called immediately after EF calls CommitAsync(CancellationToken).

CreatingSavepoint(DbTransaction, TransactionEventData, InterceptionResult)

Called just before EF intends to create a transaction savepoint.

CreatingSavepointAsync(DbTransaction, TransactionEventData, InterceptionResult, CancellationToken)

Called just before EF intends to create a transaction savepoint.

ReleasedSavepoint(DbTransaction, TransactionEventData)

Called immediately after EF releases a transaction savepoint.

ReleasedSavepointAsync(DbTransaction, TransactionEventData, CancellationToken)

Called immediately after EF releases a transaction savepoint.

ReleasingSavepoint(DbTransaction, TransactionEventData, InterceptionResult)

Called just before EF intends to release a transaction savepoint.

ReleasingSavepointAsync(DbTransaction, TransactionEventData, InterceptionResult, CancellationToken)

Called just before EF intends to release a transaction savepoint.

RolledBackToSavepoint(DbTransaction, TransactionEventData)

Called immediately after EF rolls back to a transaction savepoint.

RolledBackToSavepointAsync(DbTransaction, TransactionEventData, CancellationToken)

Called immediately after EF rolls back to a transaction savepoint.

RollingBackToSavepoint(DbTransaction, TransactionEventData, InterceptionResult)

Called just before EF intends to roll back to a transaction savepoint.

RollingBackToSavepointAsync(DbTransaction, TransactionEventData, InterceptionResult, CancellationToken)

Called just before EF intends to roll back to a transaction savepoint.

TransactionCommitted(DbTransaction, TransactionEndEventData)

Called immediately after EF calls Commit().

TransactionCommittedAsync(DbTransaction, TransactionEndEventData, CancellationToken)

Called immediately after EF calls CommitAsync(CancellationToken).

TransactionCommitting(DbTransaction, TransactionEventData, InterceptionResult)

Called just before EF intends to call Commit().

TransactionCommittingAsync(DbTransaction, TransactionEventData, InterceptionResult, CancellationToken)

Called just before EF intends to call CommitAsync(CancellationToken).

TransactionFailed(DbTransaction, TransactionErrorEventData)

Called when use of a DbTransaction has failed with an exception.

TransactionFailedAsync(DbTransaction, TransactionErrorEventData, CancellationToken)

Called when use of a DbTransaction has failed with an exception.

TransactionRolledBack(DbTransaction, TransactionEndEventData)

Called immediately after EF calls Rollback().

TransactionRolledBackAsync(DbTransaction, TransactionEndEventData, CancellationToken)

Called immediately after EF calls RollbackAsync(CancellationToken).

TransactionRollingBack(DbTransaction, TransactionEventData, InterceptionResult)

Called just before EF intends to call Rollback().

TransactionRollingBackAsync(DbTransaction, TransactionEventData, InterceptionResult, CancellationToken)

Called just before EF intends to call RollbackAsync(CancellationToken).

TransactionStarted(DbConnection, TransactionEndEventData, DbTransaction)

Called immediately after EF calls BeginTransaction(IsolationLevel).

TransactionStartedAsync(DbConnection, TransactionEndEventData, DbTransaction, CancellationToken)

Called immediately after EF calls BeginTransactionAsync(IsolationLevel, CancellationToken).

TransactionStarting(DbConnection, TransactionStartingEventData, InterceptionResult<DbTransaction>)

Called just before EF intends to call BeginTransaction(IsolationLevel).

TransactionStartingAsync(DbConnection, TransactionStartingEventData, InterceptionResult<DbTransaction>, CancellationToken)

Called just before EF intends to call BeginTransactionAsync(IsolationLevel, CancellationToken).

TransactionUsed(DbConnection, TransactionEventData, DbTransaction)

Called immediately after RelationalDatabaseFacadeExtensions.UseTransaction is called.

TransactionUsedAsync(DbConnection, TransactionEventData, DbTransaction, CancellationToken)

Called immediately after RelationalDatabaseFacadeExtensions.UseTransactionAsync is called.

Applies to