I have a some data that I need serialized to json. Below is a simplified version of the code I'm using on the backend to generate the json:
public class RawBarData
{
public string Month { get; set; }
public decimal Total { get; set; }
}
List<RawBarData> lstData == getData();
string jdata = JsonConvert.SerializedObject(lstData);
After this runs, jdata looks something like this:
[
{ Month: "January", Total: 10},
{ Month: "February", Total: 8},
{ Month: "March", Total: 4},
{ Month: "April", Total: 13},
{ Month: "May", Total: 17},
{ Month: "June", Total: 9}
]
However I need the output to look like this:
[
["January", 10],
["February", 8],
["March", 4],
["April", 13],
["May", 17],
["June", 9]
]
How can I guide json.net to serialize the data in this format?