ConfigurationProvider Class¶
Base helper class for implementing an Microsoft.Extensions.Configuration.IConfigurationProvider
- Namespace
Microsoft.Extensions.Configuration
- Assemblies
- Microsoft.Extensions.Configuration
Syntax¶
public abstract class ConfigurationProvider : IConfigurationProvider
-
class
Microsoft.Extensions.Configuration.
ConfigurationProvider
Constructors¶
-
ConfigurationProvider
()¶ Initializes a new
Microsoft.Extensions.Configuration.IConfigurationProvider
protected ConfigurationProvider()
-
Properties¶
-
Microsoft.Extensions.Configuration.ConfigurationProvider.
Data
¶ The configuration key value pairs for this provider.
Return type: System.Collections.Generic.IDictionary<System.String> protected IDictionary<string, string> Data { get; set; }
-
Methods¶
-
GetChildKeys
(System.Collections.Generic.IEnumerable<System.String>, System.String)¶ Returns the list of keys that this provider has.
Arguments: - earlierKeys (System.Collections.Generic.IEnumerable<System.String>) – The earlier keys that other providers contain.
- parentPath (System.String) – The path for the parent IConfiguration.
Return type: System.Collections.Generic.IEnumerable<System.String>
Returns: The list of keys for this provider.
public virtual IEnumerable<string> GetChildKeys(IEnumerable<string> earlierKeys, string parentPath)
-
GetReloadToken
()¶ Returns a
Microsoft.Extensions.Primitives.IChangeToken
that can be used to listen when this provider is reloaded.Return type: Microsoft.Extensions.Primitives.IChangeToken public IChangeToken GetReloadToken()
-
Load
()¶ Loads (or reloads) the data for this provider.
public virtual void Load()
-
OnReload
()¶ Triggers the reload change token and creates a new one.
protected void OnReload()
-
Set
(System.String, System.String)¶ Sets a value for a given key.
Arguments: - key (System.String) – The configuration key to set.
- value (System.String) – The value to set.
public virtual void Set(string key, string value)
-
TryGet
(System.String, out System.String)¶ Attempts to find a value with the given key, returns true if one is found, false otherwise.
Arguments: - key (System.String) – The key to lookup.
- value (System.String) – The value found at key if one is found.
Return type: System.Boolean
Returns: True if key has a value, false otherwise.
public virtual bool TryGet(string key, out string value)
-