ConfigurationBinder.GetValue ConfigurationBinder.GetValue ConfigurationBinder.GetValue Method

Definition

Overloads

GetValue(IConfiguration, Type, String) GetValue(IConfiguration, Type, String)

Extracts the value with the specified key and converts it to the specified type.

GetValue(IConfiguration, Type, String, Object) GetValue(IConfiguration, Type, String, Object)

Extracts the value with the specified key and converts it to the specified type.

GetValue<T>(IConfiguration, String) GetValue<T>(IConfiguration, String) GetValue<T>(IConfiguration, String)

Extracts the value with the specified key and converts it to type T.

GetValue<T>(IConfiguration, String, T) GetValue<T>(IConfiguration, String, T) GetValue<T>(IConfiguration, String, T)

Extracts the value with the specified key and converts it to type T.

GetValue(IConfiguration, Type, String) GetValue(IConfiguration, Type, String)

Extracts the value with the specified key and converts it to the specified type.

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

The configuration.

type
Type Type Type

The type to convert the value to.

key
String String String

The key of the configuration section's value to convert.

Returns

The converted value.

GetValue(IConfiguration, Type, String, Object) GetValue(IConfiguration, Type, String, Object)

Extracts the value with the specified key and converts it to the specified type.

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

The configuration.

type
Type Type Type

The type to convert the value to.

key
String String String

The key of the configuration section's value to convert.

defaultValue
Object Object Object

The default value to use if no value is found.

Returns

The converted value.

GetValue<T>(IConfiguration, String) GetValue<T>(IConfiguration, String) GetValue<T>(IConfiguration, String)

Extracts the value with the specified key and converts it to type T.

public static T GetValue<T> (this Microsoft.Extensions.Configuration.IConfiguration configuration, string key);
static member GetValue : Microsoft.Extensions.Configuration.IConfiguration * string -> 'T
<Extension()>
Public Function GetValue(Of T) (configuration As IConfiguration, key As String) As T
Type Parameters
T

The type to convert the value to.

Parameters
configuration
IConfiguration IConfiguration IConfiguration

The configuration.

key
String String String

The key of the configuration section's value to convert.

Returns

The converted value.

GetValue<T>(IConfiguration, String, T) GetValue<T>(IConfiguration, String, T) GetValue<T>(IConfiguration, String, T)

Extracts the value with the specified key and converts it to type T.

public static T GetValue<T> (this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, T defaultValue);
static member GetValue : Microsoft.Extensions.Configuration.IConfiguration * string * 'T -> 'T
<Extension()>
Public Function GetValue(Of T) (configuration As IConfiguration, key As String, defaultValue As T) As T
Type Parameters
T

The type to convert the value to.

Parameters
configuration
IConfiguration IConfiguration IConfiguration

The configuration.

key
String String String

The key of the configuration section's value to convert.

defaultValue

The default value to use if no value is found.

Returns

The converted value.

Applies to