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
Remarks
See Logging, events, and diagnostics for more information and examples.
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
eventDefinition
EventDefinitionBaseThe event definition.
messageGenerator
Func<EventDefinitionBase, EventData, string>A delegate that generates a log message for this event.
transaction
DbTransactionThe DbTransaction.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, or null if not known.
transactionId
GuidA correlation ID that identifies the Entity Framework transaction being used.
connectionId
GuidA correlation ID that identifies the DbConnection instance being used.
async
boolIndicates whether or not the transaction is being used asynchronously.
action
stringOne of "Commit" or "Rollback".
exception
ExceptionThe exception that was thrown when the transaction failed.
startTime
DateTimeOffsetThe start time of this event.
duration
TimeSpanThe 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; }