I have a list of two DataTables. I'm converting this list to a JSON array, but I need to add the table name for every DataTable in the JSON string.
How can I do that?
This is how I'm converting the list:
Dim json As String = JsonConvert.SerializeObject(list, New DataTableConverter())
Desired JSON output:
{
"category": [
{
"id": "1",
"desc": "default",
},
{
"id": "2",
"desc": "fun",
}
],
"images": [
{
"image ID": "1",
"link": "images/logo.jpg"
"category": "1"
},
{
"image ID": "2",
"link": "images/logo2.jpg"
"category": "2"
}
]
}