Table of Contents

Class DbContextErrorEventData

Namespace
Microsoft.EntityFrameworkCore.Diagnostics
Assembly
Microsoft.EntityFrameworkCore.dll

A DiagnosticSource event payload class for error events that reference a DbContext.

public class DbContextErrorEventData : DbContextEventData, IErrorEventData
Inheritance
DbContextErrorEventData
Implements
Derived
Inherited Members

Remarks

See Logging, events, and diagnostics for more information and examples.

Constructors

DbContextErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>, DbContext, Exception)

Constructs the event payload.

public DbContextErrorEventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator, DbContext context, Exception exception)

Parameters

eventDefinition EventDefinitionBase

The event definition.

messageGenerator Func<EventDefinitionBase, EventData, string>

A delegate that generates a log message for this event.

context DbContext

The current DbContext.

exception Exception

The exception that triggered this event.

Properties

Exception

The exception that triggered this event.

public virtual Exception Exception { get; }

Property Value

Exception