Condividi tramite


DbTransactionInterceptor.TransactionCommittingAsync Metodo

Definizione

Chiamato subito prima che EF intenda chiamare CommitAsync(CancellationToken).

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

Parametri

transaction
DbTransaction

Transazione.

eventData
TransactionEventData

Informazioni contestuali sulla connessione e sulla transazione.

result
InterceptionResult

Rappresenta il risultato corrente, se presente. Questo valore sarà IsSuppressed impostato su true se un precedente intercettore ha eliminato l'esecuzione chiamando Suppress(). Questo valore viene in genere usato come valore restituito per l'implementazione di questo metodo.

cancellationToken
CancellationToken

Oggetto CancellationToken da osservare durante l'attesa del completamento dell'attività.

Restituisce

Se IsSuppressed è false, Entity Framework continuerà come di consueto. Se IsSuppressed è true, EF elimina l'operazione che sta per eseguire. Un'implementazione normale di questo metodo per qualsiasi intercettore che non tenta di eliminare l'operazione consiste nel restituire il result valore passato.

Implementazioni

Eccezioni

Si applica a