Share via


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.

[System.Runtime.CompilerServices.Nullable(0)]
public class WarningsConfigurationBuilder
public class WarningsConfigurationBuilder
[<System.Runtime.CompilerServices.Nullable(0)>]
type WarningsConfigurationBuilder = class
type WarningsConfigurationBuilder = class
Public Class WarningsConfigurationBuilder
Inheritance
WarningsConfigurationBuilder
Attributes

Remarks

See Configuration for specific messages for more information and examples.

Constructors

Name Description
WarningsConfigurationBuilder(DbContextOptionsBuilder)

Initializes a new instance of the WarningsConfigurationBuilder class.

Methods

Name Description
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