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 } })); } }
public ActionResult <IEnumerable <GenreDto> > Get([FromQuery] GenreSearch obj) { try { var data = _getGenres.Execute(obj); return(Ok(data)); } catch { return(StatusCode(500, "Internal Server Error!")); } }