My appsettings json file
{
"StudentBirthdays": [
{ "Anne": "01/11/2000"},
{ "Peter": "29/07/2001"},
{ "Jane": "15/10/2001"},
{ "John": "Not Mentioned"}
]
}
I have a seperate config class.
public string GetConfigValue(string key)
{
var value = _configuration["AppSettings:" + key];
return !string.IsNullOrEmpty(value) ? Convert.ToString(value) : string.Empty;
}
What I have tried is,
list= _configHelper.GetConfigValue("StudentBirthdays");
For the above I dont get the values.
How can I read the values(I want to read the name of the student and his birthday seperatly).
Any help is apreciated
.GetSectionand iterate through it._configuration.GetSection, and yes, probably something like that in the_configHelperclass to provide access to it.