Прочитај на енглеском

Делите путем


OptionsBuilder<TOptions> Class

Definition

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.

Configures TOptions instances.

C#
public class OptionsBuilder<TOptions> where TOptions : class

Type Parameters

TOptions

The type of options being requested.

Inheritance
OptionsBuilder<TOptions>

Constructors

Properties

Name

Gets the default name of the TOptions instance.

Services

Gets the IServiceCollection for the options being configured.

Methods

Configure(Action<TOptions>)

Registers an action used to configure a particular type of options.

Configure<TDep>(Action<TOptions,TDep>)

Registers an action used to configure a particular type of options.

Configure<TDep1,TDep2,TDep3,TDep4,TDep5>(Action<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5>)

Registers an action used to configure a particular type of options.

Configure<TDep1,TDep2,TDep3,TDep4>(Action<TOptions,TDep1,TDep2,TDep3,TDep4>)

Registers an action used to configure a particular type of options.

Configure<TDep1,TDep2,TDep3>(Action<TOptions,TDep1,TDep2,TDep3>)

Registers an action used to configure a particular type of options.

Configure<TDep1,TDep2>(Action<TOptions,TDep1,TDep2>)

Registers an action used to configure a particular type of options.

PostConfigure(Action<TOptions>)

Registers an action used to configure a particular type of options.

PostConfigure<TDep>(Action<TOptions,TDep>)

Registers an action used to post configure a particular type of options.

PostConfigure<TDep1,TDep2,TDep3,TDep4,TDep5>(Action<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5>)

Registers an action used to post configure a particular type of options.

PostConfigure<TDep1,TDep2,TDep3,TDep4>(Action<TOptions,TDep1,TDep2,TDep3,TDep4>)

Registers an action used to post configure a particular type of options.

PostConfigure<TDep1,TDep2,TDep3>(Action<TOptions,TDep1,TDep2,TDep3>)

Registers an action used to post configure a particular type of options.

PostConfigure<TDep1,TDep2>(Action<TOptions,TDep1,TDep2>)

Registers an action used to post configure a particular type of options.

Validate(Func<TOptions,Boolean>, String)

Registers a validation action for an options type.

Validate(Func<TOptions,Boolean>)

Registers a validation action for an options type using a default failure message.

Validate<TDep>(Func<TOptions,TDep,Boolean>, String)

Registers a validation action for an options type.

Validate<TDep>(Func<TOptions,TDep,Boolean>)

Registers a validation action for an options type using a default failure message.

Validate<TDep1,TDep2,TDep3,TDep4,TDep5>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,Boolean>, String)

Registers a validation action for an options type.

Validate<TDep1,TDep2,TDep3,TDep4,TDep5>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,Boolean>)

Registers a validation action for an options type using a default failure message.

Validate<TDep1,TDep2,TDep3,TDep4>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,Boolean>, String)

Registers a validation action for an options type.

Validate<TDep1,TDep2,TDep3,TDep4>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,Boolean>)

Registers a validation action for an options type using a default failure message.

Validate<TDep1,TDep2,TDep3>(Func<TOptions,TDep1,TDep2,TDep3,Boolean>, String)

Registers a validation action for an options type.

Validate<TDep1,TDep2,TDep3>(Func<TOptions,TDep1,TDep2,TDep3,Boolean>)

Registers a validation action for an options type using a default failure message.

Validate<TDep1,TDep2>(Func<TOptions,TDep1,TDep2,Boolean>, String)

Registers a validation action for an options type.

Validate<TDep1,TDep2>(Func<TOptions,TDep1,TDep2,Boolean>)

Registers a validation action for an options type using a default failure message.

Extension Methods

Bind<TOptions>(OptionsBuilder<TOptions>, IConfiguration, Action<BinderOptions>)

Registers a configuration instance which TOptions will bind against.

Bind<TOptions>(OptionsBuilder<TOptions>, IConfiguration)

Registers a configuration instance which TOptions will bind against.

BindConfiguration<TOptions>(OptionsBuilder<TOptions>, String, Action<BinderOptions>)

Registers the dependency injection container to bind TOptions against the IConfiguration obtained from the DI service provider.

ValidateDataAnnotations<TOptions>(OptionsBuilder<TOptions>)

Register this options instance for validation of its DataAnnotations.

ValidateOnStart<TOptions>(OptionsBuilder<TOptions>)

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

BindCommandLine<TOptions>(OptionsBuilder<TOptions>)

Applies to

Производ Верзије
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)