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 receive a list of invoice objects. Now I need to add the client data to the json, so I get it from the db with something like:
var c = db.clients.FirstOrDefault(p => p.id == id_client);
But how can I add this client object to the json... so that in jquery I receive a list or similar with just 2 items: the client object, and the list of invoice objects?