Share via


OptionsBuilderConfigurationExtensions.Bind Method

Definition

Overloads

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

Registers a configuration instance which TOptions will bind against.

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

Registers a configuration instance which TOptions will bind against.

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

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

Registers a configuration instance which TOptions will bind against.

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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values may require generating dynamic code at runtime.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")]
public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> Bind<TOptions>(this Microsoft.Extensions.Options.OptionsBuilder<TOptions> optionsBuilder, Microsoft.Extensions.Configuration.IConfiguration config) where TOptions : class;
public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> Bind<TOptions>(this Microsoft.Extensions.Options.OptionsBuilder<TOptions> optionsBuilder, Microsoft.Extensions.Configuration.IConfiguration config) where TOptions : class;
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values may require generating dynamic code at runtime.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")>]
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)
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)

Type Parameters

TOptions

The options type to be configured.

Parameters

optionsBuilder
OptionsBuilder<TOptions>

The options builder to add the services to.

config
IConfiguration

The configuration being bound.

Returns

The OptionsBuilder<TOptions> so that additional calls can be chained.

Attributes

Applies to

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

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

Registers a configuration instance which TOptions will bind against.

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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values may require generating dynamic code at runtime.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")]
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;
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;
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values may require generating dynamic code at runtime.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")>]
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)
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)

Type Parameters

TOptions

The options type to be configured.

Parameters

optionsBuilder
OptionsBuilder<TOptions>

The options builder to add the services to.

config
IConfiguration

The configuration being bound.

configureBinder
Action<BinderOptions>

Used to configure the BinderOptions.

Returns

The OptionsBuilder<TOptions> so that additional calls can be chained.

Attributes

Applies to