Пример #1
0
        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));
        }
Пример #2
0
        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 }));
            }
        }
Пример #3
0
 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));
     }
 }
Пример #4
0
        public async Task <IActionResult> Update(UpdateMagazineView updateMagazine)
        {
            await _magazineService.Update(updateMagazine);

            return(Ok());
        }