How to add a Object in JSON Array.
"itms":[
{
"num":1201,
"itm_det":{
"txval":84273.8,
"rt":12,
"camt":5056.43,
"samt":5056.43,
"csamt":0
}
}
]
List<Itm> CustomerInvoitem = new List<Itm>();
DataTable dt = GetData(string.Format("SELECT BILL_DATE,(SUBSTR(CUST_GSTIN,0,2))POS,(CGST_RATE+SGST_RATE+IGST_RATE)RATE,CGST,SGST,IGST,BILL_FREIGHT,NET_AMNT FROM GST_SUMMARY_VW WHERE BRANCH_GSTIN='{0}' AND CUST_GSTIN='{1}' AND BILL_NO='{2}' ORDER BY BILL_NO ", BranchGst, CustomerGst, InvNo));
for (int i = 0; i < dt.Rows.Count; i++)
{
CustomerInvoitem.Add(new Itm
{
num = 1201,
itm_det = {Convert.ToDouble(dt.Rows[i]["BILL_FREIGHT"]) }
});
}
return CustomerInvoitem;