Ejemplo n.º 1
0
 public IActionResult Get(int id)
 {
     try
     {
         return(Ok(getGenre.Execute(id)));
     }
     catch (EntityNotFoundException e)
     {
         return(NotFound(new
         {
             Errors = new List <string> {
                 e.Message
             }
         }));
     }
     catch (Exception e)
     {
         return(StatusCode(500, new
         {
             Errors = new List <string> {
                 e.Message
             }
         }));
     }
 }
Ejemplo n.º 2
0
 public ActionResult <IEnumerable <GenreDto> > Get([FromQuery] GenreSearch obj)
 {
     try
     {
         var data = _getGenres.Execute(obj);
         return(Ok(data));
     }
     catch
     {
         return(StatusCode(500, "Internal Server Error!"));
     }
 }