Share via


IDbTransactionInterceptor.TransactionStarted Method

Definition

Called immediately after EF calls BeginTransaction(IsolationLevel).

public System.Data.Common.DbTransaction TransactionStarted (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.TransactionEndEventData eventData, System.Data.Common.DbTransaction result);
public virtual System.Data.Common.DbTransaction TransactionStarted (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.TransactionEndEventData eventData, System.Data.Common.DbTransaction result);
abstract member TransactionStarted : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEndEventData * System.Data.Common.DbTransaction -> System.Data.Common.DbTransaction
abstract member TransactionStarted : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEndEventData * System.Data.Common.DbTransaction -> System.Data.Common.DbTransaction
override this.TransactionStarted : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEndEventData * System.Data.Common.DbTransaction -> System.Data.Common.DbTransaction
Public Function TransactionStarted (connection As DbConnection, eventData As TransactionEndEventData, result As DbTransaction) As DbTransaction
Public Overridable Function TransactionStarted (connection As DbConnection, eventData As TransactionEndEventData, result As DbTransaction) As DbTransaction

Parameters

connection
DbConnection

The connection.

eventData
TransactionEndEventData

Contextual information about connection and transaction.

result
DbTransaction

The result of the call to BeginTransaction(IsolationLevel). This value is typically used as the return value for the implementation of this method.

Returns

The result that EF will use. An implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in.

Remarks

This method is still called if an interceptor suppressed creation in TransactionStarting(DbConnection, TransactionStartingEventData, InterceptionResult<DbTransaction>). In this case, result is the result returned by TransactionStarting(DbConnection, TransactionStartingEventData, InterceptionResult<DbTransaction>).

Applies to