public IHttpActionResult UpdateMediaShelf(UpdateDetail model) { if (!ModelState.IsValid) { return(BadRequest()); } _updateService.UpdateMediaShelf(model); return(Ok()); }
public IHttpActionResult UpdateHandlebarPost(UpdateDetail model) { if (!ModelState.IsValid) { return(BadRequest()); } _updateService.UpdateHandlebarPost(model); return(Ok()); }
public IHttpActionResult UpdateSprintShiftType(UpdateDetail model) { if (!ModelState.IsValid) { return(BadRequest()); } _updateService.UpdateSprintShiftType(model); return(Ok()); }
public IHttpActionResult UpdateTabletHolder(UpdateDetail model) { if (!ModelState.IsValid) { return(BadRequest()); } _updateService.UpdateTabletHolder(model); return(Ok()); }
public IHttpActionResult UpdateStagesBikeNumberPlate(UpdateDetail model) { if (!ModelState.IsValid) { return(BadRequest()); } _updateService.UpdateStagesBikeNumberPlate(model); return(Ok()); }
public void RemapLocationLink(UpdateDetail updateDetail, IUrlHelper Url, HttpRequest Request) { if (updateDetail.Resource != null) { // First element is the controller // Second element is the method // Third element is the id name string[] paths = updateDetail.Resource.Location.Split('.'); var location = Url.Action(paths[1], paths[0], new Dictionary <string, string> { { paths[2], updateDetail.Resource.Id } }, Request.Scheme); updateDetail.Resource.Location = location; } }
public void UpdateHandlebarPost(UpdateDetail model) { var repo = _unitOfWork.GetRepository <HandlebarPost>(); var itemToUpdate = repo.Get(model.Id); if (itemToUpdate == null) { throw new ArgumentNullException(); } if (model.BasePrice.HasValue) { itemToUpdate.BasePrice = model.BasePrice.Value; } if (!String.IsNullOrEmpty(model.Title)) { itemToUpdate.Title = model.Title; } repo.Update(itemToUpdate); _unitOfWork.Save(); }