public ActionResult Put(int id, [FromBody] CityDTO value) { try { _editCityCommand.Execute(value); return(NoContent()); } catch (DataNotFoundException) { return(NotFound()); } catch (DataNotAlteredException) { return(Conflict()); } catch (Exception) { return(StatusCode(500, "Server is busy at the moment, please try later")); } }
public IActionResult Put(int id, [FromBody] CityDto value) { value.Id = id; try { _editCityCommand.Execute(value); return(NoContent()); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (EntityAlreadyExistsException e) { return(Conflict(e.Message)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }