OptionsBuilderConfigurationExtensions.Bind 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Bind<TOptions>(OptionsBuilder<TOptions>, IConfiguration) |
註冊 |
Bind<TOptions>(OptionsBuilder<TOptions>, IConfiguration, Action<BinderOptions>) |
註冊 |
Bind<TOptions>(OptionsBuilder<TOptions>, IConfiguration)
註冊 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>)
註冊 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>,以便鏈結其他呼叫。