IConfiguration.GetSection(String) Metoda

Definice

Získá dílčí část konfigurace se zadaným klíčem.

public:
 Microsoft::Extensions::Configuration::IConfigurationSection ^ GetSection(System::String ^ key);
public Microsoft.Extensions.Configuration.IConfigurationSection GetSection (string key);
abstract member GetSection : string -> Microsoft.Extensions.Configuration.IConfigurationSection
Public Function GetSection (key As String) As IConfigurationSection

Parametry

key
String

Klíč oddílu konfigurace.

Návraty

Hodnota IConfigurationSection

Poznámky

Tato metoda nikdy nevrátí null. Pokud se nenajde žádný odpovídající dílčí oddíl se zadaným klíčem, vrátí se prázdný IConfigurationSection oddíl.

K dílčímu podsekci se dostanete tak, že předáte "section1:section2:section.." pro key.

Platí pro