public ActionResult Update(ButtonAddModel model) { if (!ModelState.IsValid) { return(Json(new ResultInfo() { ErrorNo = -1, ErrorMsg = ResSuggest.OperateFail + GetModelInvalidMsg() })); } var updateModel = Mapper.Map <ButtonAddModel, Button>(model); if (_buttonService.Update(updateModel)) { return(Json(new ResultInfo() { ErrorNo = 0, ErrorMsg = ResSuggest.UpdateSuccess })); } else { return(Json(new ResultInfo() { ErrorNo = -1, ErrorMsg = ResSuggest.UpdateFail })); } }
public async Task <IActionResult> Update(ButtonDto update) { if (await _btnService.Update(update)) { return(NoContent()); } return(BadRequest($"Updating Button {update.ID} failed on save")); }
public async Task <IActionResult> Update([FromBody] ButtonDto updateButton) { return(ActionResultInstance(await _userService.Update(updateButton, updateButton.Id))); }
public Task <IResultModel> Update(ButtonUpdateModel model) { return(_service.Update(model)); }