I thought the following would be a pretty common task and assumed there would be an easy solution for it, but i can't find one.
If I have a datatable in the following structure.
ID Name Active
ID1 John TRUE
ID2 Bill FALSE
I would like to serialize it as a JSON object where the ID column is a node in the JSON object like:
[
{
"ID1": {
"Name": "John",
"Active": "True"
},
"ID2": {
"Name": "Bill",
"Active": "False"
}
}
]
I looked into JSON.NET but could not get it to work. Edit: I'm using C#