public HttpResponseMessage Post([FromBody] Bundle bundle) { if (bundle == null) { return(Request.CreateResponse(HttpStatusCode.OK, new Bundle())); } var addBundleDto = Mapper.Map(_bundleService.AddBundle(bundle)); return(Request.CreateResponse(HttpStatusCode.OK, addBundleDto)); }
public bool AddBundleS([FromBody] BundleListModel bundleList) { int projectId = bundleList.projectId; List <Bundle> bundles = bundleList.Bundles; foreach (var bundle in bundles) { if (bundle != null) { BundleOptions bundleOpt = new BundleOptions { Prize = bundle.Prize, Description = bundle.Description }; Bundle addedBundle = bundleService.AddBundle(bundleOpt, projectId); } } return(true); }