public ActionResult AddPackageDetail(AngularAPICalls APIcalls) //PackageMater pkg, PackaDetail[] ListOfTestPackage, string PackageName { // var data = JsonConvert.DeserializeObject<List<PackaDetail>>(APIcalls.json); try { var packageMasterData = JsonConvert.DeserializeObject <PackageMater>(APIcalls.PackageMasterJson); List <PackaDetail> packageDetailData = JsonConvert.DeserializeObject <List <PackaDetail> >(APIcalls.PackageDetailsJson); var pkgM = _testService.AddPackageMaster(packageMasterData); if (pkgM != 0) { foreach (var item in packageDetailData) { var VpackageDetail = _testService.AddPackageDetail(item, pkgM); } return(Json(new { message = "Save record successfully", success = true, }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { message = "Failed to save records", success = false }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { } return(null); }