i want to read the Date "datum" form this json string in to a List of DateTime:
{
"Neujahrstag": {
"datum": "2016-01-01",
"hinweis": ""
},
"Karfreitag": {
"datum": "2016-03-25",
"hinweis": ""
},
"Ostermontag": {
"datum": "2016-03-28",
"hinweis": ""
},
"Tag der Arbeit": {
"datum": "2016-05-01",
"hinweis": ""
},
"Christi Himmelfahrt": {
"datum": "2016-05-05",
"hinweis": ""
},
"Pfingstmontag": {
"datum": "2016-05-16",
"hinweis": ""
},
"Tag der Deutschen Einheit": {
"datum": "2016-10-03",
"hinweis": ""
},
"Reformationstag": {
"datum": "2016-10-31",
"hinweis": ""
},
"1. Weihnachtstag": {
"datum": "2016-12-25",
"hinweis": ""
},
"2. Weihnachtstag": {
"datum": "2016-12-26",
"hinweis": ""
}
}
I have no idea how to do that.
I use the following code to get the json string and parse it but i have no idea how to get to a List or Array.
using (WebClient wc = new WebClient())
{
var json = wc.DownloadString("https://feiertage-api.de/api/?jahr=2020&nur_land=MV");
JObject result = JObject.Parse(json);
MessageBox.Show(DateTime.ParseExact(result.First.First.First.First.ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString());
}
Is there an easy way to do this or do i have to write a costume deserializer for this kind of json?