public async Task <HttpResponseMessage> Update(RackBoxModel item) { if (ModelState.IsValid) { await Task.Run(() => { this._rackService.Update(item); }); return(Request.CreateResponse(HttpStatusCode.OK, new ResponseMessage <object>(true, "Success", null))); } return(Request.CreateResponse(HttpStatusCode.OK, new ResponseMessage <object>(false, MessageString.INVALID_REQUEST_PARMS, null))); }
public void Update(RackBoxModel item) { try { if (item == null) { throw new ArgumentNullException("item"); } Expression <Func <RackBox> > entity = () => new RackBox { Name = item.Name, Description = item.Description, SecondaryStatus = item.SecondaryStatus }; this._rackRepository.Update(entity, x => x.Id == item.Id); } catch (Exception ex) { throw; } }