public IActionResult GetById(int id)
 {
     try
     {
         return(Ok(_citiesService.Get(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Beispiel #2
0
 public ActionResult <IEnumerable <City> > Get()
 {
     try
     {
         return(Ok(_service.Get()));
     }
     catch (System.Exception error)
     {
         return(BadRequest(error.Message));
     }
 }