ConfigurationBuilder Class

Used to build key/value based configuration settings for use in an application.

Namespace
Microsoft.Extensions.Configuration
Assemblies
  • Microsoft.Extensions.Configuration

Syntax

public class ConfigurationBuilder : IConfigurationBuilder
class Microsoft.Extensions.Configuration.ConfigurationBuilder

Methods

Add(Microsoft.Extensions.Configuration.IConfigurationSource)

Adds a new configuration source.

Arguments:source (Microsoft.Extensions.Configuration.IConfigurationSource) – The configuration source to add.
Return type:Microsoft.Extensions.Configuration.IConfigurationBuilder
Returns:The same Microsoft.Extensions.Configuration.IConfigurationBuilder.
public IConfigurationBuilder Add(IConfigurationSource source)
Build()

Builds an Microsoft.Extensions.Configuration.IConfiguration with keys and values from the set of providers registered in Microsoft.Extensions.Configuration.ConfigurationBuilder.Sources.

Return type:Microsoft.Extensions.Configuration.IConfigurationRoot
Returns:An Microsoft.Extensions.Configuration.IConfigurationRoot with keys and values from the registered providers.
public IConfigurationRoot Build()

Properties

Microsoft.Extensions.Configuration.ConfigurationBuilder.Properties

Gets a key/value collection that can be used to share data between the Microsoft.Extensions.Configuration.IConfigurationBuilder and the registered Microsoft.Extensions.Configuration.IConfigurationProviders.

Return type:System.Collections.Generic.Dictionary<System.String>
public Dictionary<string, object> Properties { get; }
Microsoft.Extensions.Configuration.ConfigurationBuilder.Sources

Returns the sources used to obtain configuation values.

Return type:System.Collections.Generic.IEnumerable<Microsoft.Extensions.Configuration.IConfigurationSource>
public IEnumerable<IConfigurationSource> Sources { get; }