string Directory { get; }
Gets the directory path containing configuration files.
Default implementation of IConfigFileLocationProvider that uses the application's base directory.
A configuration provider that retrieves values from environment variables.
string NormalizeSegment(string value)
Converts a key/environment segment to uppercase (via string.ToUpperInvariant) and flattens separators by replacing '.' and '-' with a single '_'. Used for legacy flat environment-variable lookup.
string NormalizeHierarchicalKey(string value)
Converts a key to uppercase (via string.ToUpperInvariant), splits on '.' and '-' as hierarchical delimiters, removes empty segments, and joins segments using "__". Used for hierarchical environment-variable lookup while preserving path boundaries.
Defines the central manager for configuration, which aggregates multiple IConfigProvider instances.
Provides the directory path where configuration files are located.
string Directory { get; }
Gets the directory path containing configuration files.
A configuration provider that reads settings from JSON files (e.g., appsettings.json, config_*.json).
A base class for strongly-typed configuration objects where the value is a struct.
TThe struct type of the configuration value.bool HasValue { get; set; }
Gets a value indicating whether the configuration has a value.
bool IsDefaultValue { get; set; }
Gets a value indicating whether the current value is the default value.
T? Value { get; set; }
Gets the configuration value.
T? DefaultValue { get; }
Gets the default value for the configuration if none is found in the source.
A module that registers configuration management services and automatically discovers and registers configuration objects.
Specifies the configuration key or path for a type.
string? ExtractKey(object obj)
Extracts the configuration key from an object's type attribute.
objThe object to extract the key from.The configuration key, or null if not specified.
string? ExtractKey(Type type)
Extracts the configuration key from a type's attribute.
typeThe type to extract the key from.The configuration key, or null if not specified.
string GetKeyPath(Type type)
Computes the full configuration key path for a type, recursively including declaring types unless Root is true.
typeThe type to compute the path for.The computed configuration key path.
string Key { get; }
Gets the configuration key or path for this type.
bool Root { get; }
Gets a value indicating whether this key should be treated as a root key, ignoring the declaring type hierarchy.
Defines a provider that can retrieve configuration values.
T? GetValue<T>(string environment, string key)
Retrieves a configuration value for a specific environment and key.
TThe type of the configuration value.environmentThe environment name (e.g., "Production").keyThe configuration key.The configuration value, or the default value of T if not found.
int Priority { get; }
Higher number means higher priority. When multiple providers provide the same key, the one with the highest priority wins.
string Name { get; }
Gets the name of the configuration provider.
Defines a configuration provider that also provides environment information.
A base class for strongly-typed configuration objects.
TThe type of the configuration value.bool HasValue { get; set; }
Gets a value indicating whether the configuration has a value (either from source or default).
bool IsDefaultValue { get; set; }
Gets a value indicating whether the current value is the default value.
T? Value { get; set; }
Gets the configuration value.
T? DefaultValue { get; }
Gets the default value for the configuration if none is found in the source.
Default implementation of IConfigManager that aggregates configuration from multiple sources.
void LogKeyNotFound(string key, string environment)
Logs that a configuration key was not found.
keyThe configuration key.environmentThe environment name.void LogRetrievedFromEnvironment(string key, string environment, string source)
Logs that a configuration key was retrieved from a specific source.
keyThe configuration key.environmentThe environment name.sourceThe source of the configuration value.Defines a configuration object that can be initialized using a configuration manager.
void Init(IConfigManager configManager, IEnvironmentProvider environmentProvider, string key)
Initializes the configuration object.
configManagerThe configuration manager to use for retrieving values.environmentProviderThe environment provider.keyThe root configuration key for this object.