I wish to serialize from C sharp to JSON. I would like the output to be
[
[
{ "Info": "item1", "Count": 5749 },
{ "Info": "item2", "Count": 2610 },
{ "Info": "item3", "Count": 1001 },
{ "Info": "item4", "Count": 1115 },
{ "Info": "item5", "Count": 1142 },
"June",
37547
],
"Monday",
32347
]
What would my data structure in C# look like?
Would I have something like
public class InfoCount
{
public InfoCount (string Info, int Count)
{
this.Info = Info;
this.Count = Count;
}
public string Info;
public int Count;
}
List<object> json = new List<object>();
json[0] = new List<object>();
json[0].Add(new InfoCount("item1", 5749));
json[0].Add(new InfoCount("item2", 2610));
json[0].Add(new InfoCount("item3", 1001));
json[0].Add(new InfoCount("item4", 1115));
json[0].Add(new InfoCount("item5", 1142));
json[0].Add("June");
json[0].Add(37547);
json.Add("Monday");
json.Add(32347);
? I am using .NET 4.0.