This idea of this repo is to show how to develop a library that should :
- Allow to use it own IOptions
- Read it from wellknown
SectionName - Use the already computed
IConfigurationthat aConsumerdoes on it own (here it use bothappsettings.jsonandappsettings.Development.json) - Allow to override it in the
Consumerstartup - The lib should have the final word with a
PostConfigurefor field validation. For example is a value must be positve it could default it again if the supplied value is negative
The result in this scenario is :
{
"Value": {
"V": "V default value",
"W": "Value w from appsettings.json",
"X": "Value x from appsettings.Development.json",
"Y": "Y value from consumer startup",
"Z": 0
}
}