Class TransactionErrorEventData
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
The DiagnosticSource event payload base class for RelationalEventId transaction error events.
public class TransactionErrorEventData : TransactionEndEventData, IErrorEventData
- Inheritance
-
TransactionErrorEventData
- Implements
-
IErrorEventData
- Inherited Members
Constructors
TransactionErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>, DbTransaction, DbContext, Guid, Guid, bool, string, Exception, DateTimeOffset, TimeSpan)
Constructs the event payload.
public TransactionErrorEventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator, DbTransaction transaction, DbContext context, Guid transactionId, Guid connectionId, bool async, string action, Exception exception, DateTimeOffset startTime, TimeSpan duration)
Parameters
eventDefinitionEventDefinitionBaseThe event definition.
messageGeneratorFunc<EventDefinitionBase, EventData, string>A delegate that generates a log message for this event.
transactionDbTransactionThe DbTransaction.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, or null if not known.
transactionIdGuidA correlation ID that identifies the Entity Framework transaction being used.
connectionIdGuidA correlation ID that identifies the DbConnection instance being used.
asyncboolIndicates whether or not the transaction is being used asynchronously.
actionstringOne of "Commit" or "Rollback".
exceptionExceptionThe exception that was thrown when the transaction failed.
startTimeDateTimeOffsetThe start time of this event.
durationTimeSpanThe duration this event.
Properties
Action
One of "Commit" or "Rollback".
public virtual string Action { get; }
Property Value
Exception
The exception that was thrown when the transaction failed.
public virtual Exception Exception { get; }