I am new in linq query. I have got a task to create a json from db datas using linq query. My db is
Here i want to create a json like the below format
{
"label": "Invoices",
"items": [
{
"label": "Valpara_Jan",
"items": [
{
"label": "Estate1_Jan"
},
{
"label": "Estate2_Jan"
}
]
},
{
"label": "Munnar_Jan"
}
]
}
How can I create the json? The data should based on the parent id. For eg: Valpara and Munnar must come under invoice. Please help