public ActionResult GetSalesData() { dynamic salesList = 0; try { if (ModelState.IsValid) { SaleServiceClient service = new SaleServiceClient(); salesList = service.GetSalesData(); //return Json(vehicleList, JsonRequestBehavior.AllowGet); } } catch (Exception ex) { ModelState.AddModelError("error", "Something Went Wrong"); salesList = null; throw ex; } return(Json(salesList, JsonRequestBehavior.AllowGet)); }