Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IConfiguration.GetSection(String) Method

Definition

Namespace:
Microsoft.Extensions.Configuration
Assembly:
Microsoft.Extensions.Configuration.Abstractions.dll
Package:
Microsoft.Extensions.Configuration.Abstractions v11.0.0-preview.5.26302.115
Source:
IConfiguration.cs
Source:
IConfiguration.cs
Source:
IConfiguration.cs
Source:
IConfiguration.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets a configuration sub-section with the specified key.

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

Parameters

key
String

The key of the configuration section.

Returns

The IConfigurationSection.

Remarks

This method will never return null. If no matching sub-section is found with the specified key, an empty IConfigurationSection will be returned.

Applies to


Feedback

Was this page helpful?