I'm call an API that returns the following json
{
"services":{
"Home":{
"Homecall":{
"id":"10"
},
"Two Day":{
"id":"11"
},
"Three Day":{
"id":"12"
}
}
}
}
What would be the best possible way to parse this so it returns 'Home' as a unqiue variable, "homecall","Two day" and "three day" along with their ID in c#?
Homeis a dictionary/object with attributes namedHomeCall,Two Day,Three Day. You can deserialize it toDictionary<string,Whatever>Dictionary<string,Whatever>asHome's type. Unless you want evenservicesto be a dictionary. What does this JSON document contain? And what do you want to do with its contents?