Table of Contents

Class ConnectionCreatingEventData

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

The DiagnosticSource event payload for ConnectionCreating events.

public class ConnectionCreatingEventData : DbContextEventData
Inheritance
ConnectionCreatingEventData

Remarks

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

Constructors

ConnectionCreatingEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>, DbContext?, string?, Guid, DateTimeOffset)

Constructs the event payload.

public ConnectionCreatingEventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator, DbContext? context, string? connectionString, Guid connectionId, DateTimeOffset startTime)

Parameters

eventDefinition EventDefinitionBase

The event definition.

messageGenerator Func<EventDefinitionBase, EventData, string>

A delegate that generates a log message for this event.

context DbContext

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

connectionString string

The connection string for the new connection, if known.

connectionId Guid

A correlation ID that identifies the DbConnection instance being used.

startTime DateTimeOffset

The start time of this event.

Properties

ConnectionId

A correlation ID that identifies the DbConnection instance being used.

public virtual Guid ConnectionId { get; }

Property Value

Guid

ConnectionString

The connection string for the new connection, if known.

public virtual string? ConnectionString { get; }

Property Value

string

StartTime

The start time of this event.

public virtual DateTimeOffset StartTime { get; }

Property Value

DateTimeOffset