Udostępnij za pośrednictwem


ConfigurationBinder.GetValue Metoda

Definicja

Przeciążenia

GetValue(IConfiguration, Type, String)

Wyodrębnia wartość z określonym kluczem i konwertuje ją na określony typ.

GetValue(IConfiguration, Type, String, Object)

Wyodrębnia wartość z określonym kluczem i konwertuje ją na określony typ.

GetValue<T>(IConfiguration, String)

Wyodrębnia wartość z określonym kluczem i konwertuje ją na typ T.

GetValue<T>(IConfiguration, String, T)

Wyodrębnia wartość z określonym kluczem i konwertuje ją na typ T.

GetValue(IConfiguration, Type, String)

Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs

Wyodrębnia wartość z określonym kluczem i konwertuje ją na określony typ.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ GetValue(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, Type ^ type, System::String ^ key);
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);
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

Parametry

configuration
IConfiguration

Konfiguracja.

type
Type

Typ, na który ma być konwertowana wartość.

key
String

Klucz wartości sekcji konfiguracji do przekonwertowania.

Zwraca

Wartość przekonwertowana.

Dotyczy

GetValue(IConfiguration, Type, String, Object)

Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs

Wyodrębnia wartość z określonym kluczem i konwertuje ją na określony typ.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ GetValue(Microsoft::Extensions::Configuration::IConfiguration ^ configuration, Type ^ type, System::String ^ key, System::Object ^ defaultValue);
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);
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

Parametry

configuration
IConfiguration

Konfiguracja.

type
Type

Typ, na który ma być konwertowana wartość.

key
String

Klucz wartości sekcji konfiguracji do przekonwertowania.

defaultValue
Object

Wartość domyślna do użycia, jeśli nie zostanie znaleziona żadna wartość.

Zwraca

Wartość przekonwertowana.

Dotyczy

GetValue<T>(IConfiguration, String)

Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs

Wyodrębnia wartość z określonym kluczem i konwertuje ją na typ T.

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

Parametry typu

T

Typ, na który ma być konwertowana wartość.

Parametry

configuration
IConfiguration

Konfiguracja.

key
String

Klucz wartości sekcji konfiguracji do przekonwertowania.

Zwraca

T

Wartość przekonwertowana.

Dotyczy

GetValue<T>(IConfiguration, String, T)

Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs
Źródło:
ConfigurationBinder.cs

Wyodrębnia wartość z określonym kluczem i konwertuje ją na typ T.

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

Parametry typu

T

Typ, na który ma być konwertowana wartość.

Parametry

configuration
IConfiguration

Konfiguracja.

key
String

Klucz wartości sekcji konfiguracji do przekonwertowania.

defaultValue
T

Wartość domyślna do użycia, jeśli nie zostanie znaleziona żadna wartość.

Zwraca

T

Wartość przekonwertowana.

Dotyczy