I have an appsettings.json file which looks like this:
{
\"someSetting\": {
\"subSettings\": [
\"one\",
\"two\",
var settingsSection = config.GetSection["someSettings:subSettings"];
var subSettings = new List;
foreach (var section in settingsSection.GetChildren())
{
subSettings.Add(section.Value);
}
This should give you the values you need, stored in subSettings
Apologies for bringing up a semi-old thread. I had difficulty finding an answer as a good amount of methods are deprecated, like Get
and GetValue
. This should be fine if you only need a simple solution without the configuration binder. :)