OptionsBuilderConfigurationExtensions.Bind 方法

定义

重载

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

注册将对其绑定 TOptions 的配置实例。

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

注册将对其绑定 TOptions 的配置实例。

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

Source:
OptionsBuilderConfigurationExtensions.cs
Source:
OptionsBuilderConfigurationExtensions.cs
Source:
OptionsBuilderConfigurationExtensions.cs
Source:
OptionsBuilderConfigurationExtensions.cs

注册将对其绑定 TOptions 的配置实例。

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Bind(Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ optionsBuilder, Microsoft::Extensions::Configuration::IConfiguration ^ config);
public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> Bind<TOptions> (this Microsoft.Extensions.Options.OptionsBuilder<TOptions> optionsBuilder, Microsoft.Extensions.Configuration.IConfiguration config) where TOptions : class;
static member Bind : Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> * Microsoft.Extensions.Configuration.IConfiguration -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> (requires 'Options : null)
<Extension()>
Public Function Bind(Of TOptions As Class) (optionsBuilder As OptionsBuilder(Of TOptions), config As IConfiguration) As OptionsBuilder(Of TOptions)

类型参数

TOptions

要配置的选项类型。

参数

optionsBuilder
OptionsBuilder<TOptions>

向其中添加服务的选项生成器。

config
IConfiguration

要绑定的配置。

返回

OptionsBuilder<TOptions>,以便可以链接其他调用。

适用于

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

Source:
OptionsBuilderConfigurationExtensions.cs
Source:
OptionsBuilderConfigurationExtensions.cs
Source:
OptionsBuilderConfigurationExtensions.cs
Source:
OptionsBuilderConfigurationExtensions.cs

注册将对其绑定 TOptions 的配置实例。

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Bind(Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ optionsBuilder, Microsoft::Extensions::Configuration::IConfiguration ^ config, Action<Microsoft::Extensions::Configuration::BinderOptions ^> ^ configureBinder);
public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> Bind<TOptions> (this Microsoft.Extensions.Options.OptionsBuilder<TOptions> optionsBuilder, Microsoft.Extensions.Configuration.IConfiguration config, Action<Microsoft.Extensions.Configuration.BinderOptions>? configureBinder) where TOptions : class;
static member Bind : Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> * Microsoft.Extensions.Configuration.IConfiguration * Action<Microsoft.Extensions.Configuration.BinderOptions> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> (requires 'Options : null)
<Extension()>
Public Function Bind(Of TOptions As Class) (optionsBuilder As OptionsBuilder(Of TOptions), config As IConfiguration, configureBinder As Action(Of BinderOptions)) As OptionsBuilder(Of TOptions)

类型参数

TOptions

要配置的选项类型。

参数

optionsBuilder
OptionsBuilder<TOptions>

向其中添加服务的选项生成器。

config
IConfiguration

要绑定的配置。

configureBinder
Action<BinderOptions>

用于配置 BinderOptions

返回

OptionsBuilder<TOptions>,以便可以链接其他调用。

适用于