IDbTransactionInterceptor.TransactionUsedAsync Method

Definition

Called immediately after RelationalDatabaseFacadeExtensions.UseTransactionAsync is called.

C#
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);
C#
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);
C#
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);

Parameters

connection
DbConnection

The connection.

eventData
TransactionEventData

Contextual information about connection and transaction.

result
DbTransaction

The DbTransaction that was passed to RelationalDatabaseFacadeExtensions.UseTransactionAsync. This value is typically used as the return value for the implementation of this method.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A Task containing the value that will be used as the effective value passed to RelationalDatabaseFacadeExtensions.UseTransactionAsync An implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in, often using FromResult<TResult>(TResult)

Exceptions

Applies to

Produkt Versioner
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0