WarningsConfigurationBuilder WarningsConfigurationBuilder Class

Definition

Configures the runtime behavior of warnings generated by Entity Framework. You can set a default behavior and behaviors for each warning type.

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
Public Class WarningsConfigurationBuilder
Inheritance
System.ObjectSystem.Object
WarningsConfigurationBuilderWarningsConfigurationBuilder

Constructors

WarningsConfigurationBuilder(WarningsConfiguration) WarningsConfigurationBuilder(WarningsConfiguration)

Initializes a new instance of the WarningsConfigurationBuilder class.

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

public WarningsConfigurationBuilder(WarningsConfiguration warningsConfiguration)
Public Sub New(warningsConfiguration As WarningsConfiguration)
Parameters
warningsConfiguration
WarningsConfiguration WarningsConfiguration

The internal object used to store configuration.

Properties

Configuration Configuration

Gets the internal object used to store configuration.

public virtual WarningsConfiguration Configuration { get; }
Public Overridable ReadOnly Property Configuration As WarningsConfiguration

Methods

Default(WarningBehavior) Default(WarningBehavior)

Sets the default behavior when a warning is generated.

public virtual WarningsConfigurationBuilder Default(WarningBehavior warningBehavior)
Public Overridable Function Default(warningBehavior As WarningBehavior) As WarningsConfigurationBuilder
Parameters
warningBehavior
WarningBehavior WarningBehavior

The desired behavior.

Returns

The same builder instance so that multiple calls can be chained.

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

Ignore(CoreEventId[]) Ignore(CoreEventId())

Causes nothing to happen when the specified core warnings are generated. Database providers (and other extensions) may provide extension method overloads of this method to configure this behavior for warnings they generate.

public virtual WarningsConfigurationBuilder Ignore(params CoreEventId[] coreEventIds)
Public Overridable Function Ignore(ParamArray coreEventIds As CoreEventId()) As WarningsConfigurationBuilder
Parameters
coreEventIds
CoreEventId[] CoreEventId()

The CoreEventId(s) for the warnings.

Returns

The same builder instance so that multiple calls can be chained.

Log(CoreEventId[]) Log(CoreEventId())

Causes a warning to be logged when the specified core warnings are generated. Database providers (and other extensions) may provide extension method overloads of this method to configure this behavior for warnings they generate.

public virtual WarningsConfigurationBuilder Log(params CoreEventId[] coreEventIds)
Public Overridable Function Log(ParamArray coreEventIds As CoreEventId()) As WarningsConfigurationBuilder
Parameters
coreEventIds
CoreEventId[] CoreEventId()

The CoreEventId(s) for the warnings.

Returns

The same builder instance so that multiple calls can be chained.

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

Throw(CoreEventId[]) Throw(CoreEventId())

Causes an exception to be thrown when the specified core warnings are generated. Database providers (and other extensions) may provide extension method overloads of this method to configure this behavior for warnings they generate.

public virtual WarningsConfigurationBuilder Throw(params CoreEventId[] coreEventIds)
Public Overridable Function Throw(ParamArray coreEventIds As CoreEventId()) As WarningsConfigurationBuilder
Parameters
coreEventIds
CoreEventId[] CoreEventId()

The CoreEventId(s) for the warnings.

Returns

The same builder instance so that multiple calls can be chained.

ToString() ToString()

Inherited from System.Object