Table of Contents

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 EventDefinitionBase

The event definition.

messageGenerator Func<EventDefinitionBase, EventData, string>

A delegate that generates a log message for this event.

transaction DbTransaction

The DbTransaction.

context DbContext

The Microsoft.EntityFrameworkCore.DbContext currently being used, or null if not known.

transactionId Guid

A correlation ID that identifies the Entity Framework transaction being used.

connectionId Guid

A correlation ID that identifies the DbConnection instance being used.

async bool

Indicates whether or not the transaction is being used asynchronously.

action string

One of "Commit" or "Rollback".

exception Exception

The exception that was thrown when the transaction failed.

startTime DateTimeOffset

The start time of this event.

duration TimeSpan

The duration this event.

Properties

Action

One of "Commit" or "Rollback".

public virtual string Action { get; }

Property Value

string

Exception

The exception that was thrown when the transaction failed.

public virtual Exception Exception { get; }

Property Value

Exception