ConfigurationBinder.Bind Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Bind(IConfiguration, Object) |
Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively. |
Bind(IConfiguration, Object, Action<BinderOptions>) |
Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively. |
Bind(IConfiguration, String, Object) |
Attempts to bind the given object instance to the configuration section specified by the key by matching property names against configuration keys recursively. |
Bind(IConfiguration, Object)
- Source:
- ConfigurationBinder.cs
- Source:
- ConfigurationBinder.cs
- Source:
- ConfigurationBinder.cs
Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively.
public:
[System::Runtime::CompilerServices::Extension]
static void Bind(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, System::Object ^ instance);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")]
public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object? instance);
public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object? instance);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")>]
static member Bind : Microsoft.Extensions.Configuration.IConfiguration * obj -> unit
static member Bind : Microsoft.Extensions.Configuration.IConfiguration * obj -> unit
<Extension()>
Public Sub Bind (configuration As IConfiguration, instance As Object)
Parameters
- configuration
- IConfiguration
The configuration instance to bind.
- instance
- Object
The object to bind.
- Attributes
Applies to
Bind(IConfiguration, Object, Action<BinderOptions>)
- Source:
- ConfigurationBinder.cs
- Source:
- ConfigurationBinder.cs
- Source:
- ConfigurationBinder.cs
Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively.
public:
[System::Runtime::CompilerServices::Extension]
static void Bind(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, System::Object ^ instance, Action<Microsoft::Extensions::Configuration::BinderOptions ^> ^ configureOptions);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")]
public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object? instance, Action<Microsoft.Extensions.Configuration.BinderOptions>? configureOptions);
public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object? instance, Action<Microsoft.Extensions.Configuration.BinderOptions>? configureOptions);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")>]
static member Bind : Microsoft.Extensions.Configuration.IConfiguration * obj * Action<Microsoft.Extensions.Configuration.BinderOptions> -> unit
static member Bind : Microsoft.Extensions.Configuration.IConfiguration * obj * Action<Microsoft.Extensions.Configuration.BinderOptions> -> unit
<Extension()>
Public Sub Bind (configuration As IConfiguration, instance As Object, configureOptions As Action(Of BinderOptions))
Parameters
- configuration
- IConfiguration
The configuration instance to bind.
- instance
- Object
The object to bind.
- configureOptions
- Action<BinderOptions>
Configures the binder options.
- Attributes
Applies to
Bind(IConfiguration, String, Object)
- Source:
- ConfigurationBinder.cs
- Source:
- ConfigurationBinder.cs
- Source:
- ConfigurationBinder.cs
Attempts to bind the given object instance to the configuration section specified by the key by matching property names against configuration keys recursively.
public:
[System::Runtime::CompilerServices::Extension]
static void Bind(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, System::String ^ key, System::Object ^ instance);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")]
public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, object? instance);
public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, object? instance);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")>]
static member Bind : Microsoft.Extensions.Configuration.IConfiguration * string * obj -> unit
static member Bind : Microsoft.Extensions.Configuration.IConfiguration * string * obj -> unit
<Extension()>
Public Sub Bind (configuration As IConfiguration, key As String, instance As Object)
Parameters
- configuration
- IConfiguration
The configuration instance to bind.
- key
- String
The key of the configuration section to bind.
- instance
- Object
The object to bind.
- Attributes