So I have this JsonResult:
[HttpPost]
public JsonResult getJsonInvoicesClient(int id_client)
{
var a = db.invoices
.Where(x => x.id_client == id_client)
.ToList();
return Json(a);
}
and in jquery I get a list of account objects. Now I need to add client data in json, so I get it from db with something like:
var c = db.clients.FirstOrDefault(p => p.id == id_client);
But how can I add this client object to json ... so that in jquery I get a list or similar with only two elements: the client object and the list of invoice objects?
source
share