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
ILoggingOptionsLogging options.
eventId
EventIdThe EventId.
level
LogLevelThe LogLevel at which the event will be logged.
eventIdCode
stringA string representing the code that should be passed to ConfigureWarnings(Action<WarningsConfigurationBuilder>).
Properties
EventId
The EventId.
public virtual EventId EventId { get; }
Property Value
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
Level
The LogLevel at which the event will be logged.
public virtual LogLevel Level { get; }
Property Value
WarningBehavior
The configured WarningBehavior.
public virtual WarningBehavior WarningBehavior { get; }
Property Value
Methods
WarningAsError(string)
Returns a warning-as-error exception wrapping the given message for this event.
protected virtual Exception WarningAsError(string message)
Parameters
message
stringThe message to wrap.