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