Description
Describe the issue or suggestion
The current returns description of GetSection()
indicates that it returns null
. That is incorrect.
The specified ConfigurationSection object, or null if the requested section does not exist.
The return type is not marked as nullable in the source code:
https://github.com/dotnet/runtime/blob/main/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Configuration.cs#L165
public ConfigurationSection GetSection(string sectionName)
In the ASP.NET Core docs it correctly states "GetSection never returns null":
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/configuration/index.md?plain=1#L705
GetSection never returns null. If a matching section isn't found, an empty IConfigurationSection is returned.
The correction should be made here:
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Configuration/Configuration.xml#L356