ConfigurationBinder.Get ConfigurationBinder.Get ConfigurationBinder.Get Method

Definition

Overloads

Get(IConfiguration, Type) 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>) 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) Get<T>(IConfiguration) 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>) Get<T>(IConfiguration, Action<BinderOptions>) 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) 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.

public static object Get (this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type);
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Type -> obj
Parameters
configuration
IConfiguration IConfiguration IConfiguration

The configuration instance to bind.

type
Type Type Type

The type of the new instance to bind.

Returns

The new instance if successful, null otherwise.

Get(IConfiguration, Type, Action<BinderOptions>) 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.

public static object Get (this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type, Action<Microsoft.Extensions.Configuration.BinderOptions> configureOptions);
static member Get : Microsoft.Extensions.Configuration.IConfiguration * Type * Action<Microsoft.Extensions.Configuration.BinderOptions> -> obj
Parameters
configuration
IConfiguration IConfiguration IConfiguration

The configuration instance to bind.

type
Type 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.

Get<T>(IConfiguration) Get<T>(IConfiguration) 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.

public static T Get<T> (this Microsoft.Extensions.Configuration.IConfiguration configuration);
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 IConfiguration IConfiguration

The configuration instance to bind.

Returns

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

Get<T>(IConfiguration, Action<BinderOptions>) Get<T>(IConfiguration, Action<BinderOptions>) 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.

public static T Get<T> (this Microsoft.Extensions.Configuration.IConfiguration configuration, Action<Microsoft.Extensions.Configuration.BinderOptions> configureOptions);
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 IConfiguration IConfiguration

The configuration instance to bind.

configureOptions
Action<BinderOptions>

Configures the binder options.

Returns

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

Applies to