Update: I think I have to rephrase the question: I'm getting the continent, country and capital lists from lets say a db source and I have to construct a JSON object that has the given structure.
I have to create a Dto object that represents the following JSON object format:
{
"Europe":{
"France":"Paris",
"UK":"London",
"Germany":"Berlin"
}
}
where "Europe" is a value for an object of type Continent and "France", "UK" and "London" are values of the object Country:
public class Country
{
public string Name { get; set; }
public string Capital { get; set; }
}
How would you represent that JSON object with object classes?