Κοινή χρήση μέσω


ConfigurationRoot Class

Definition

Represents the root node for a configuration.

public ref class ConfigurationRoot : IDisposable, Microsoft::Extensions::Configuration::IConfigurationRoot
public class ConfigurationRoot : IDisposable, Microsoft.Extensions.Configuration.IConfigurationRoot
type ConfigurationRoot = class
    interface IConfigurationRoot
    interface IConfiguration
    interface IDisposable
Public Class ConfigurationRoot
Implements IConfigurationRoot, IDisposable
Inheritance
ConfigurationRoot
Implements

Constructors

ConfigurationRoot(IList<IConfigurationProvider>)

Initializes a Configuration root with a list of providers.

Properties

Item[String]

Gets or sets the value corresponding to a configuration key.

Providers

The IConfigurationProviders for this configuration.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetChildren()

Gets the immediate children subsections.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetReloadToken()

Returns a IChangeToken that can be used to observe when this configuration is reloaded.

GetSection(String)

Gets a configuration subsection with the specified key.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Reload()

Forces the configuration values to be reloaded from the underlying sources.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Extension Methods

Bind(IConfiguration, Object, Action<BinderOptions>)

Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively.

Bind(IConfiguration, Object)

Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively.

Bind(IConfiguration, String, Object)

Attempts to bind the given object instance to the configuration section specified by the key by matching property names against configuration keys recursively.

Get(IConfiguration, Type, Action<BinderOptions>)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

Get(IConfiguration, Type)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

Get<T>(IConfiguration, Action<BinderOptions>)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

Get<T>(IConfiguration)

Attempts to bind the configuration instance to a new instance of type T. If this configuration section has a value, that will be used. Otherwise binding by matching property names against configuration keys recursively.

GetValue(IConfiguration, Type, String, Object)

Extracts the value with the specified key and converts it to the specified type.

GetValue(IConfiguration, Type, String)

Extracts the value with the specified key and converts it to the specified type.

GetValue<T>(IConfiguration, String, T)

Extracts the value with the specified key and converts it to type T.

GetValue<T>(IConfiguration, String)

Extracts the value with the specified key and converts it to type T.

AsEnumerable(IConfiguration, Boolean)

Get the enumeration of key value pairs within the IConfiguration

AsEnumerable(IConfiguration)

Get the enumeration of key value pairs within the IConfiguration

GetConnectionString(IConfiguration, String)

Gets the specified connection string from the specified configuration. Shorthand for GetSection("ConnectionStrings")[name].

GetRequiredSection(IConfiguration, String)

Gets a configuration subsection with the specified key.

GetDebugView(IConfigurationRoot, Func<ConfigurationDebugViewContext,String>)

Generates a human-readable view of the configuration showing where each value came from.

GetDebugView(IConfigurationRoot)

Generates a human-readable view of the configuration showing where each value came from.

Applies to