Always using ConfigurationMonitor<TSection> to track config sections enables:
- Discovery of configuration classes and section keys.
- Improved performance of configuration retrieval and updating
to use the new pattern:
- make the configuration section class inherit from
IConfigurationSection<T> (for instance class ConfigSection : IConfigurationSection<ConfigSection>
- register
ConfigurationMonitor<ConfigSection> in the resolver as a single instance.
- resolve
ConfigurationMonitor<ConfigSection> instead of IConfiguration in the classes which need access to the config section.