public IHttpActionResult UpdateCount(UpdateAddCountDTO model) { var result = productService.ChangeItemCount(model); if (!result.Success) { return(BadRequest()); } return(Ok()); }
public IResult ChangeItemCount(UpdateAddCountDTO model) { var result = new Result(); try { var instance = repository.Get(x => x.Id == model.Id); instance.AddCount = model.AddCount; repository.Update(instance); result.Success = true; } catch (Exception e) { result.Message = e.ToString(); } return(result); }