<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0-preview.1.24080.9" />

ConfigurationExtensions

public static class ConfigurationExtensions
Extension methods for configuration classes.
public static IConfigurationBuilder Add<TSource>(this IConfigurationBuilder builder, Action<TSource> configureSource) where TSource : IConfigurationSource

Adds a new configuration source.

public static IEnumerable<KeyValuePair<string, string>> AsEnumerable(this IConfiguration configuration)

Get the enumeration of key-value pairs within the IConfiguration.

public static IEnumerable<KeyValuePair<string, string>> AsEnumerable(this IConfiguration configuration, bool makePathsRelative)

Gets the enumeration of key-value pairs within the IConfiguration.

public static bool Exists(this IConfigurationSection section)

Determines whether the section has a Value or has children.

public static string GetConnectionString(this IConfiguration configuration, string name)

Retrieves the value with the specified key from the ConnectionStrings section of the configuration source. Calling this method is shorthand for GetSection("ConnectionStrings")[name].

public static IConfigurationSection GetRequiredSection(this IConfiguration configuration, string key)

Gets the configuration subsection that has the specified key.