I have 3 datatables in my dataset. Table A has one to many relationship with B and C. I want to create Json like below using Linq in c#. Can someone please help me? I would like to thanks in advance to everyone who will guide me or provide me input to my question.
{
"A": [
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"B": [
{
"id": "1001",
"type": "Regular"
}
],
"C": [
{
"id": "5001",
"type": "None"
},
{
"id": "5002",
"type": "Glazed"
}
]
}
],
"A": [
{
"id": "0002",
"type": "Cupcake",
"name": "Cake",
"ppu": 2.43,
"B": [
{
"id": "1001",
"type": "Regular"
}
],
"C": [
{
"id": "5001",
"type": "None"
},
{
"id": "5002",
"type": "Glazed"
}
]
}
]
}