RelationalLoggerExtensions.TransactionStartedAsync Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Registra el TransactionStarted evento.
public static System.Threading.Tasks.Task<System.Data.Common.DbTransaction> TransactionStartedAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction> TransactionStartedAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration, System.Threading.CancellationToken cancellationToken = default);
static member TransactionStartedAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbTransaction * Guid * DateTimeOffset * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbTransaction>
static member TransactionStartedAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbTransaction * Guid * DateTimeOffset * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction>
<Extension()>
Public Function TransactionStartedAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Transaction), connection As IRelationalConnection, transaction As DbTransaction, transactionId As Guid, startTime As DateTimeOffset, duration As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DbTransaction)
<Extension()>
Public Function TransactionStartedAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Transaction), connection As IRelationalConnection, transaction As DbTransaction, transactionId As Guid, startTime As DateTimeOffset, duration As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbTransaction)
Parámetros
- diagnostics
- IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>
Registrador de diagnóstico que se va a usar.
- connection
- IRelationalConnection
La conexión.
- transaction
- DbTransaction
Transacción.
- transactionId
- Guid
Identificador de correlación asociado a DbTransaction.
- startTime
- DateTimeOffset
Hora a la que se inició la operación.
- duration
- TimeSpan
Cantidad de tiempo antes de que se abrió la conexión.
- cancellationToken
- CancellationToken
Que CancellationToken se debe observar mientras se espera a que se complete la tarea.
Devoluciones
Resultado de la ejecución, que un interceptor puede haber modificado.
Excepciones
Si se cancela CancellationToken.