OptionsBuilder<TOptions> 类

定义

用于配置 TOptions 实例。Used to configure TOptions instances.

generic <typename TOptions>
 where TOptions : classpublic ref class OptionsBuilder
public class OptionsBuilder<TOptions> where TOptions : class
type OptionsBuilder<'Options (requires 'Options : null)> = class
Public Class OptionsBuilder(Of TOptions)

类型参数

TOptions

请求的选项的类型。The type of options being requested.

继承
OptionsBuilder<TOptions>

构造函数

OptionsBuilder<TOptions>(IServiceCollection, String)

构造函数。Constructor.

属性

Name

TOptions 实例的默认名称。The default name of the TOptions instance.

Services

正在配置的选项的 IServiceCollectionThe IServiceCollection for the options being configured.

方法

Configure(Action<TOptions>)

注册用于配置特定类型的选项的操作。Registers an action used to configure a particular type of options. 这些都在所有 PostConfigure(Action<TOptions>) 之前运行。These are run before all PostConfigure(Action<TOptions>).

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

注册用于配置特定类型的选项的操作。Registers an action used to configure a particular type of options. 这些都在所有 PostConfigure(Action<TOptions>) 之前运行。These are run before all PostConfigure(Action<TOptions>).

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

注册用于配置特定类型的选项的操作。Registers an action used to configure a particular type of options. 这些都在所有 PostConfigure(Action<TOptions>) 之前运行。These are run before all PostConfigure(Action<TOptions>).

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

注册用于配置特定类型的选项的操作。Registers an action used to configure a particular type of options. 这些都在所有 PostConfigure(Action<TOptions>) 之前运行。These are run before all PostConfigure(Action<TOptions>).

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

注册用于配置特定类型的选项的操作。Registers an action used to configure a particular type of options. 这些都在所有 PostConfigure(Action<TOptions>) 之前运行。These are run before all PostConfigure(Action<TOptions>).

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

注册用于配置特定类型的选项的操作。Registers an action used to configure a particular type of options. 这些都在所有 PostConfigure(Action<TOptions>) 之前运行。These are run before all PostConfigure(Action<TOptions>).

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
PostConfigure(Action<TOptions>)

注册用于配置特定类型的选项的操作。Registers an action used to configure a particular type of options. 这些都在所有 Configure(Action<TOptions>) 之后运行。These are run after all Configure(Action<TOptions>).

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

注册用于对特定类型的选项进行后期配置的操作。Registers an action used to post configure a particular type of options. 这些都在所有 Configure(Action<TOptions>) 之后运行。These are run after all Configure(Action<TOptions>).

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. 这些都在所有 Configure(Action<TOptions>) 之后运行。These are run after all Configure(Action<TOptions>).

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

注册用于对特定类型的选项进行后期配置的操作。Registers an action used to post configure a particular type of options. 这些都在所有 Configure(Action<TOptions>) 之后运行。These are run after all Configure(Action<TOptions>).

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

注册用于对特定类型的选项进行后期配置的操作。Registers an action used to post configure a particular type of options. 这些都在所有 Configure(Action<TOptions>) 之后运行。These are run after all Configure(Action<TOptions>).

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

注册用于对特定类型的选项进行后期配置的操作。Registers an action used to post configure a particular type of options. 这些都在所有 Configure(Action<TOptions>) 之后运行。These are run after all Configure(Action<TOptions>).

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Validate(Func<TOptions,Boolean>)

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

Validate(Func<TOptions,Boolean>, String)

注册选项类型的验证操作。Register a validation action for an options type.

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

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

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

注册选项类型的验证操作。Register a validation action for an options type.

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

使用默认失败消息注册选项类型的验证操作。Register 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)

注册选项类型的验证操作。Register a validation action for an options type.

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

使用默认失败消息注册选项类型的验证操作。Register 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)

注册选项类型的验证操作。Register a validation action for an options type.

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

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

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

注册选项类型的验证操作。Register a validation action for an options type.

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

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

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

注册选项类型的验证操作。Register a validation action for an options type.

扩展方法

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

注册将对其绑定 TOptions 的配置实例。Registers a configuration instance which TOptions will bind against.

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

注册将对其绑定 TOptions 的配置实例。Registers a configuration instance which TOptions will bind against.

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

注册依赖关系注入容器,以便将 TOptions 绑定到从 DI 服务提供程序获取的 IConfigurationRegisters the dependency injection container to bind TOptions against the IConfiguration obtained from the DI service provider.

ValidateDataAnnotations<TOptions>(OptionsBuilder<TOptions>)

注册此选项实例以验证其 DataAnnotations。Registers this options instance for validation of its DataAnnotations.

ValidateOnStart<TOptions>(OptionsBuilder<TOptions>)

适用于