共用方式為


OptionsBuilderConfigurationExtensions.Bind 方法

定義

多載

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

註冊 TOptions 將繫結的組態執行個體。

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

註冊 TOptions 將繫結的組態執行個體。

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

來源:
OptionsBuilderConfigurationExtensions.cs
來源:
OptionsBuilderConfigurationExtensions.cs
來源:
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>)

來源:
OptionsBuilderConfigurationExtensions.cs
來源:
OptionsBuilderConfigurationExtensions.cs
來源:
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>,以便鏈結其他呼叫。

適用於