WarningsConfigurationBuilder Class

Definition

Configures the runtime behavior of events generated by Entity Framework. You can set a default behavior and behaviors for each event ID.

This class is used within the ConfigureWarnings(Action<WarningsConfigurationBuilder>) API and it is not designed to be directly constructed in your application code.

public class WarningsConfigurationBuilder
type WarningsConfigurationBuilder = class
Public Class WarningsConfigurationBuilder
Inheritance
WarningsConfigurationBuilder

Remarks

See Configuration for specific messages for more information and examples.

Constructors

WarningsConfigurationBuilder(DbContextOptionsBuilder)

Initializes a new instance of the WarningsConfigurationBuilder class.

Methods

Default(WarningBehavior)

Sets the default behavior when a warning is generated.

Ignore(EventId[])

Causes nothing to happen when the specified event occurs, regardless of default configuration.

Log(EventId[])

Causes an event to be logged, regardless of default configuration.

Log(ValueTuple<EventId,LogLevel>[])

Causes an event to be logged at the specified level, regardless of default configuration.

Throw(EventId[])

Causes an exception to be thrown when the specified event occurs, regardless of default configuration.

Applies to