ConfigurationBinder.GetValue Metod

Definition

Överlagringar

Name Description
GetValue(IConfiguration, Type, String)

Extraherar värdet med den angivna nyckeln och konverterar det till den angivna typen.

GetValue(IConfiguration, Type, String, Object)

Extraherar värdet med den angivna nyckeln och konverterar det till den angivna typen.

GetValue<T>(IConfiguration, String)

Extraherar värdet med den angivna nyckeln och konverterar det till typ T.

GetValue<T>(IConfiguration, String, T)

Extraherar värdet med den angivna nyckeln och konverterar det till typ T.

GetValue(IConfiguration, Type, String)

Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs

Extraherar värdet med den angivna nyckeln och konverterar det till den angivna typen.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ GetValue(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, Type ^ type, System::String ^ key);
[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? GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type, string key);
public static object? GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type, string key);
[<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 GetValue : Microsoft.Extensions.Configuration.IConfiguration * Type * string -> obj
static member GetValue : Microsoft.Extensions.Configuration.IConfiguration * Type * string -> obj
<Extension()>
Public Function GetValue (configuration As IConfiguration, type As Type, key As String) As Object

Parametrar

configuration
IConfiguration

Konfigurationen.

type
Type

Den typ som värdet ska konverteras till.

key
String

Nyckeln till konfigurationsavsnittets värde som ska konverteras.

Returer

Det konverterade värdet.

Attribut

Gäller för

GetValue(IConfiguration, Type, String, Object)

Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs

Extraherar värdet med den angivna nyckeln och konverterar det till den angivna typen.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ GetValue(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, Type ^ type, System::String ^ key, System::Object ^ defaultValue);
[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? GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type, string key, object? defaultValue);
public static object? GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, Type type, string key, object? defaultValue);
[<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 GetValue : Microsoft.Extensions.Configuration.IConfiguration * Type * string * obj -> obj
static member GetValue : Microsoft.Extensions.Configuration.IConfiguration * Type * string * obj -> obj
<Extension()>
Public Function GetValue (configuration As IConfiguration, type As Type, key As String, defaultValue As Object) As Object

Parametrar

configuration
IConfiguration

Konfigurationen.

type
Type

Den typ som värdet ska konverteras till.

key
String

Nyckeln till konfigurationsavsnittets värde som ska konverteras.

defaultValue
Object

Standardvärdet som ska användas om inget värde hittas.

Returer

Det konverterade värdet.

Attribut

Gäller för

GetValue<T>(IConfiguration, String)

Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs

Extraherar värdet med den angivna nyckeln och konverterar det till typ T.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T GetValue(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, System::String ^ key);
[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? GetValue<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key);
public static T? GetValue<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key);
[<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 GetValue : Microsoft.Extensions.Configuration.IConfiguration * string -> 'T
static member GetValue : Microsoft.Extensions.Configuration.IConfiguration * string -> 'T
<Extension()>
Public Function GetValue(Of T) (configuration As IConfiguration, key As String) As T

Typparametrar

T

Den typ som värdet ska konverteras till.

Parametrar

configuration
IConfiguration

Konfigurationen.

key
String

Nyckeln till konfigurationsavsnittets värde som ska konverteras.

Returer

T

Det konverterade värdet.

Attribut

Gäller för

GetValue<T>(IConfiguration, String, T)

Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs
Källa:
ConfigurationBinder.cs

Extraherar värdet med den angivna nyckeln och konverterar det till typ T.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T GetValue(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, System::String ^ key, T defaultValue);
[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? GetValue<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, T defaultValue);
public static T? GetValue<T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, T defaultValue);
[<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 GetValue : Microsoft.Extensions.Configuration.IConfiguration * string * 'T -> 'T
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

Typparametrar

T

Den typ som värdet ska konverteras till.

Parametrar

configuration
IConfiguration

Konfigurationen.

key
String

Nyckeln till konfigurationsavsnittets värde som ska konverteras.

defaultValue
T

Standardvärdet som ska användas om inget värde hittas.

Returer

T

Det konverterade värdet.

Attribut

Gäller för