Afficher en anglais

Partage via


OptionsBuilderExtensions.ValidateOnStart<TOptions> Method

Definition

Enforces options validation check on start rather than at run time.

public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> ValidateOnStart<TOptions> (this Microsoft.Extensions.Options.OptionsBuilder<TOptions> optionsBuilder) where TOptions : class;

Type Parameters

TOptions

The type of options.

Parameters

optionsBuilder
OptionsBuilder<TOptions>

The OptionsBuilder<TOptions> to configure options instance.

Returns

The OptionsBuilder<TOptions> so that additional calls can be chained.

Applies to

Produit Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)