public ActionResult <Book> GetBook(int id, int authorId) { var book = booksServices.GetBook(id, authorId); if (book == null) { return(NotFound($"No exite el libro con id: {id}")); } return(book); }
public ActionResult <BookModel> GetBook(int BookId) { try { return(Ok(_booksServices.GetBook(BookId))); } catch (NotFoundOperationException ex) { return(NotFound(ex.Message)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, $"Something Happened: {ex.Message}")); } }