Facilitates binding of Configuration Files into POCO objects. This then allows the config to be used within other classes via dependency injection etc
-
Asp.Net Standard/Core Dependency Injection
- Use the provided
services.AddConfiguration()method
- Use the provided
-
Other Containers
- Register an instance of
ConfigurationBuilderas theIConfigurationBuildertype as a Singleton - Register an instance of
ConfigurationManageras a Singleton aginst theIConfigurationinterface
- Register an instance of
-
TConfig Bind(string sectionName = default)- Binds the config settings found in the config section to the given
TConfigtype sectionNameallows the user to override the section name in the config file
- Binds the config settings found in the config section to the given
-
string GetConnectionString(string name)- Gets the Connection String with the given name
-
TSetting GetSetting(string name, TSetting defaultValue = default)- Gets the setting from the config file with the given name as an instance of
TSetting - If not found in the config file, the value of
defaultValuewill be returned
- Gets the setting from the config file with the given name as an instance of