Share via


WarningsConfiguration.TryWithExplicit(EventId, WarningBehavior) Method

Definition

Creates a new instance with the given explicit WarningBehavior set for the given event ID, but only if no explicit behavior has already been set. It is unusual to call this method directly. Instead use WarningsConfigurationBuilder.

public virtual Microsoft.EntityFrameworkCore.Diagnostics.WarningsConfiguration TryWithExplicit (Microsoft.Extensions.Logging.EventId eventId, Microsoft.EntityFrameworkCore.WarningBehavior warningBehavior);
abstract member TryWithExplicit : Microsoft.Extensions.Logging.EventId * Microsoft.EntityFrameworkCore.WarningBehavior -> Microsoft.EntityFrameworkCore.Diagnostics.WarningsConfiguration
override this.TryWithExplicit : Microsoft.Extensions.Logging.EventId * Microsoft.EntityFrameworkCore.WarningBehavior -> Microsoft.EntityFrameworkCore.Diagnostics.WarningsConfiguration
Public Overridable Function TryWithExplicit (eventId As EventId, warningBehavior As WarningBehavior) As WarningsConfiguration

Parameters

eventId
EventId

The event ID for which the behavior should be set.

warningBehavior
WarningBehavior

The behavior to set.

Returns

A new instance with the behavior set, or this instance if a behavior was already set.

Applies to