Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Microsoft.Extensions.Options Namespace

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Provides types used for implementing the options pattern.

Classes

Name Description
ConfigurationChangeTokenSource<TOptions>

Creates IChangeTokens so that IOptionsMonitor<TOptions> gets notified when IConfiguration changes.

ConfigureFromConfigurationOptions<TOptions>

Configures an option instance by using Bind(IConfiguration, Object) against an IConfiguration.

ConfigureNamedOptions<TOptions>

Implementation of IConfigureNamedOptions<TOptions>.

ConfigureNamedOptions<TOptions,TDep>

Implementation of IConfigureNamedOptions<TOptions>.

ConfigureNamedOptions<TOptions,TDep1,TDep2>

Implementation of IConfigureNamedOptions<TOptions>.

ConfigureNamedOptions<TOptions,TDep1,TDep2,TDep3>

Implementation of IConfigureNamedOptions<TOptions>.

ConfigureNamedOptions<TOptions,TDep1,TDep2,TDep3,TDep4>

Implementation of IConfigureNamedOptions<TOptions>.

ConfigureNamedOptions<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5>

Implementation of IConfigureNamedOptions<TOptions>.

ConfigureOptions<TOptions>

Implementation of IConfigureOptions<TOptions>.

DataAnnotationValidateOptions<TOptions>

Implementation of IValidateOptions<TOptions> that uses DataAnnotation's Validator for validation.

NamedConfigureFromConfigurationOptions<TOptions>

Configures an option instance by using Bind(IConfiguration, Object) against an IConfiguration.

Options

Helper class for options.

OptionsBuilder<TOptions>

Configures TOptions instances.

OptionsCache<TOptions>

Caches TOptions instances.

OptionsFactory<TOptions>

Implementation of IOptionsFactory<TOptions>.

OptionsManager<TOptions>

Implements IOptions<TOptions> and IOptionsSnapshot<TOptions>.

OptionsMonitor<TOptions>

Implements IOptionsMonitor<TOptions>.

OptionsMonitorExtensions

Extension methods for IOptionsMonitor<TOptions>.

OptionsValidationException

Represents the exception that's thrown when options validation fails.

OptionsValidatorAttribute

Triggers the automatic generation of the implementation of IValidateOptions<TOptions> at compile time.

OptionsWrapper<TOptions>

Wraps the options instance.

PostConfigureOptions<TOptions>

Implementation of IPostConfigureOptions<TOptions>.

PostConfigureOptions<TOptions,TDep>

Implementation of IPostConfigureOptions<TOptions>.

PostConfigureOptions<TOptions,TDep1,TDep2>

Implementation of IPostConfigureOptions<TOptions>.

PostConfigureOptions<TOptions,TDep1,TDep2,TDep3>

Implementation of IPostConfigureOptions<TOptions>.

PostConfigureOptions<TOptions,TDep1,TDep2,TDep3,TDep4>

Implementation of IPostConfigureOptions<TOptions>.

PostConfigureOptions<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5>

Implementation of IPostConfigureOptions<TOptions>.

ValidateEnumeratedItemsAttribute

Marks a field or property to be enumerated; each enumerated object is validated.

ValidateObjectMembersAttribute

Marks a field or property to be validated transitively.

ValidateOptions<TOptions>

Implementation of IValidateOptions<TOptions>

ValidateOptions<TOptions,TDep>

Implementation of IValidateOptions<TOptions>

ValidateOptions<TOptions,TDep1,TDep2>

Implementation of IValidateOptions<TOptions>.

ValidateOptions<TOptions,TDep1,TDep2,TDep3>

Implementation of IValidateOptions<TOptions>

ValidateOptions<TOptions,TDep1,TDep2,TDep3,TDep4>

Implementation of IValidateOptions<TOptions>

ValidateOptions<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5>

Implementation of IValidateOptions<TOptions>

ValidateOptionsResult

Represents the result of an options validation.

ValidateOptionsResultBuilder

Builds ValidateOptionsResult with support for multiple error messages.

Interfaces

Name Description
IConfigureNamedOptions<TOptions>

Represents something that configures the TOptions type.

IConfigureOptions<TOptions>

Represents something that configures the TOptions type.

IOptions<TOptions>

Retrieves configured TOptions instances.

IOptionsChangeTokenSource<TOptions>

Fetches a IChangeToken that's used for tracking options changes.

IOptionsFactory<TOptions>

Creates TOptions instances.

IOptionsMonitor<TOptions>

Monitors changes on a TOptions instance.

IOptionsMonitorCache<TOptions>

Used by IOptionsMonitor<TOptions> to cache TOptions instances.

IOptionsSnapshot<TOptions>

Used to access the value of TOptions for the lifetime of a request.

IPostConfigureOptions<TOptions>

Represents something that configures the TOptions type.

IStartupValidator

Used by hosts to validate options during startup.

IValidateOptions<TOptions>

Validates options.

Remarks

For more information about implementing the options pattern, see Options pattern in .NET.


Feedback

Was this page helpful?