IDbTransactionInterceptor.TransactionUsedAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Chiamato immediatamente dopo RelationalDatabaseFacadeExtensions.UseTransactionAsync la chiamata.
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)
Parametri
- connection
- DbConnection
Connessione.
- eventData
- TransactionEventData
Informazioni contestuali sulla connessione e sulla transazione.
- result
- DbTransaction
Oggetto DbTransaction passato a RelationalDatabaseFacadeExtensions.UseTransactionAsync. 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
Oggetto Task contenente il valore che verrà utilizzato come valore effettivo passato a RelationalDatabaseFacadeExtensions.UseTransactionAsync Un'implementazione di questo metodo per qualsiasi intercettore che non sta tentando di modificare il risultato consiste nel restituire il result
valore passato, spesso utilizzando FromResult<TResult>(TResult)
Eccezioni
Se CancellationToken viene annullato.