I have a C# program and I am trying to serialize some of my items as JSON array to be compatible with dygraphs. However, I cannot figure out how to do it, all the examples I find are about deserialization. My object is:
{
"file": {
"header" : {
"param1" : "test",
"param2" : "test2"
},
"points": [
{
"timestamp": "47602070",
"s1": "4",
"s2": "3",
},
{
"timestamp": "47602370",
"s1": "-4",
"s2": "2",
}
]
}
}
What I would need would be:
{
"file": {
"header" : {
"param1" : "test",
"param2" : "test2"
},
"points": [
["47602070","4","3"]
["47602370","-4","2"]
]
}
}
Basically, converting all the Point objects to array while serializing. Is this something easily doable with JSON.NET custom converter ?
Kind regards