Table of Contents

Class EventData

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

A base class for all Entity Framework DiagnosticSource event payloads.

public class EventData
Inheritance
EventData
Derived
Inherited Members

Remarks

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

Constructors

EventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>)

Constructs the event payload.

public EventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator)

Parameters

eventDefinition EventDefinitionBase

The event definition.

messageGenerator Func<EventDefinitionBase, EventData, string>

A delegate that generates a log message for this event.

Properties

EventId

The EventId that defines the message ID and name.

public virtual EventId EventId { get; }

Property Value

EventId

EventIdCode

A string representing the code where this event is defined.

public virtual string EventIdCode { get; }

Property Value

string

LogLevel

The LogLevel that would be used to log message for this event.

public virtual LogLevel LogLevel { get; }

Property Value

LogLevel

Methods

ToString()

A logger message describing this event.

public override string ToString()

Returns

string

A logger message describing this event.