Table of Contents

Class EventDefinitionBase

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

Base class for event definitions.

public abstract class EventDefinitionBase
Inheritance
EventDefinitionBase
Derived
Inherited Members

Remarks

See Implementation of database providers and extensions for more information and examples.

Constructors

EventDefinitionBase(ILoggingOptions, EventId, LogLevel, string)

Creates an event definition instance.

protected EventDefinitionBase(ILoggingOptions loggingOptions, EventId eventId, LogLevel level, string eventIdCode)

Parameters

loggingOptions ILoggingOptions

Logging options.

eventId EventId

The EventId.

level LogLevel

The LogLevel at which the event will be logged.

eventIdCode string

A string representing the code that should be passed to ConfigureWarnings(Action<WarningsConfigurationBuilder>).

Properties

EventId

The EventId.

public virtual EventId EventId { get; }

Property Value

EventId

EventIdCode

A string representing the code that should be passed to ConfigureWarnings(Action<WarningsConfigurationBuilder>) to suppress this event as an error.

public virtual string EventIdCode { get; }

Property Value

string

Level

The LogLevel at which the event will be logged.

public virtual LogLevel Level { get; }

Property Value

LogLevel

WarningBehavior

The configured WarningBehavior.

public virtual WarningBehavior WarningBehavior { get; }

Property Value

WarningBehavior

Methods

WarningAsError(string)

Returns a warning-as-error exception wrapping the given message for this event.

protected virtual Exception WarningAsError(string message)

Parameters

message string

The message to wrap.

Returns

Exception