Compartir a través de


IDbTransactionInterceptor.TransactionUsedAsync Método

Definición

Se llama inmediatamente después RelationalDatabaseFacadeExtensions.UseTransactionAsync de llamar a .

public System.Threading.Tasks.Task<System.Data.Common.DbTransaction> TransactionUsedAsync (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData eventData, System.Data.Common.DbTransaction result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction> TransactionUsedAsync (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData eventData, System.Data.Common.DbTransaction result, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction> TransactionUsedAsync (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData eventData, System.Data.Common.DbTransaction result, System.Threading.CancellationToken cancellationToken = default);
abstract member TransactionUsedAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData * System.Data.Common.DbTransaction * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbTransaction>
abstract member TransactionUsedAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData * System.Data.Common.DbTransaction * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction>
abstract member TransactionUsedAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData * System.Data.Common.DbTransaction * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction>
override this.TransactionUsedAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData * System.Data.Common.DbTransaction * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction>
Public Function TransactionUsedAsync (connection As DbConnection, eventData As TransactionEventData, result As DbTransaction, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DbTransaction)
Public Function TransactionUsedAsync (connection As DbConnection, eventData As TransactionEventData, result As DbTransaction, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbTransaction)
Public Overridable Function TransactionUsedAsync (connection As DbConnection, eventData As TransactionEventData, result As DbTransaction, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbTransaction)

Parámetros

connection
DbConnection

La conexión.

eventData
TransactionEventData

Información contextual sobre la conexión y la transacción.

result
DbTransaction

que DbTransaction se pasó a RelationalDatabaseFacadeExtensions.UseTransactionAsync. Este valor se usa normalmente como valor devuelto para la implementación de este método.

cancellationToken
CancellationToken

Que CancellationToken se debe observar mientras se espera a que se complete la tarea.

Devoluciones

que Task contiene el valor que se usará como valor efectivo pasado a RelationalDatabaseFacadeExtensions.UseTransactionAsync una implementación de este método para cualquier interceptor que no intente cambiar el resultado es devolver el result valor pasado, a menudo mediante FromResult<TResult>(TResult)

Excepciones

Se aplica a