Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ConfigurationBinder.Get Method

Definition

Namespace:
Microsoft.Extensions.Configuration
Assembly:
Microsoft.Extensions.Configuration.Binder.dll
Package:
Microsoft.Extensions.Configuration.Binder v11.0.0-preview.5.26302.115

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

Name Description
Get(IConfiguration, Type)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

Get(IConfiguration, Type, Action<BinderOptions>)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

Get<T>(IConfiguration)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

Get<T>(IConfiguration, Action<BinderOptions>)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

Get(IConfiguration, Type)

Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Get(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, Type ^ type);
[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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
public static object? Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type);
public static object? Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type);
[<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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")>]
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Type -> obj
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Type -> obj
<Extension()>
Public Function Get (configuration As IConfiguration, type As Type) As Object

Parameters

configuration
IConfiguration

The configuration instance to bind.

type
Type

The type of the new instance to bind.

Returns

The new instance if successful, null otherwise.

Attributes

Applies to

Get(IConfiguration, Type, Action<BinderOptions>)

Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Get(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, Type ^ type, 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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
public static object? Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type, Action<Microsoft.Extensions.Configuration.BinderOptions>? configureOptions);
public static object? Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type, 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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")>]
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Type * Action<Microsoft.Extensions.Configuration.BinderOptions> -> obj
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Type * Action<Microsoft.Extensions.Configuration.BinderOptions> -> obj
<Extension()>
Public Function Get (configuration As IConfiguration, type As Type, configureOptions As Action(Of BinderOptions)) As Object

Parameters

configuration
IConfiguration

The configuration instance to bind.

type
Type

The type of the new instance to bind.

configureOptions
Action<BinderOptions>

Configures the binder options.

Returns

The new instance if successful, null otherwise.

Attributes

Applies to

Get<T>(IConfiguration)

Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T Get(Microsoft::Extensions::Configuration::IConfiguration ^ configuration);
[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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
public static T? Get<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration);
public static T? Get<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration);
[<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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")>]
static member Get : Microsoft.Extensions.Configuration.IConfiguration -> 'T
static member Get : Microsoft.Extensions.Configuration.IConfiguration -> 'T
<Extension()>
Public Function Get(Of T) (configuration As IConfiguration) As T

Type Parameters

T

The type of the new instance to bind.

Parameters

configuration
IConfiguration

The configuration instance to bind.

Returns

T

The new instance of T if successful, default(T) otherwise.

Attributes

Applies to

Get<T>(IConfiguration, Action<BinderOptions>)

Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs
Source:
ConfigurationBinder.cs

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T Get(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, 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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
public static T? Get<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, Action<Microsoft.Extensions.Configuration.BinderOptions>? configureOptions);
public static T? Get<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, 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("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")>]
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Action<Microsoft.Extensions.Configuration.BinderOptions> -> 'T
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Action<Microsoft.Extensions.Configuration.BinderOptions> -> 'T
<Extension()>
Public Function Get(Of T) (configuration As IConfiguration, configureOptions As Action(Of BinderOptions)) As T

Type Parameters

T

The type of the new instance to bind.

Parameters

configuration
IConfiguration

The configuration instance to bind.

configureOptions
Action<BinderOptions>

Configures the binder options.

Returns

T

The new instance of T if successful, default(T) otherwise.

Attributes

Applies to


Feedback

Was this page helpful?