public IActionResult Update(XEditVM model) { var mappedModel = _mapper.Map <XEditSM>(model); var result = _magService.Update(mappedModel); if (result.IsOk()) { return(Json(200)); } return(Json(result.Status)); }
public IActionResult Update(int id, [FromBody] MagazineDto magazineDto) { var magazine = _mapper.Map <MagazineDto>(magazineDto); magazine.Id = id; try { _magazineService.Update(magazine); return(Ok()); } catch (AppException ex) { return(BadRequest(new { message = ex.Message })); } }
public IActionResult Update([FromBody] UpdateMagazineViewModel magazine) { try { _magazineService.Update(magazine); return(Ok(magazine)); } catch (BusinessLogicException exception) { return(BadRequest(exception.Message)); } catch (Exception exception) { _logger.LogInformation(exception.Message); return(StatusCode((int)HttpStatusCode.InternalServerError)); } }
public async Task <IActionResult> Update(UpdateMagazineView updateMagazine) { await _magazineService.Update(updateMagazine); return(Ok()); }