Partilhar via


IDbTransactionInterceptor.TransactionStarted Método

Definição

Chamado imediatamente após o EF chamar 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

Parâmetros

connection
DbConnection

A conexão.

eventData
TransactionEndEventData

Informações contextuais sobre conexão e transação.

result
DbTransaction

O resultado da chamada para BeginTransaction(IsolationLevel). Esse valor normalmente é usado como o valor retornado para a implementação desse método.

Retornos

O resultado que o EF usará. Uma implementação desse método para qualquer interceptador que não está tentando alterar o resultado é retornar o result valor passado.

Comentários

Esse método ainda será chamado se um interceptador suprimiu a criação em TransactionStarting(DbConnection, TransactionStartingEventData, InterceptionResult<DbTransaction>). Nesse caso, result é o resultado retornado por TransactionStarting(DbConnection, TransactionStartingEventData, InterceptionResult<DbTransaction>).

Aplica-se a