public ActionResult Get(int id) { try { return(Ok(_getCityCommand.Execute(id))); } catch (DataNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500)); } }
public ActionResult <CityDto> Get(int id) { try { var city = _getCityCommand.Execute(id); return(Ok(city)); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }