ConfigurationBinder.Get Method

Definition

Overloads

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<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(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);
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.

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);
Type Parameters
T

The type of the new instance to bind.

Parameters
configuration
IConfiguration

The configuration instance to bind.

Returns

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

Applies to