public async Task <ActionResult <Book> > GetBook() { var book = await _context.GetBook(); if (book == null) { return(NotFound()); } return(Ok(book)); }
// Selects a book by ID and returns to BookDetail public ActionResult BookDetail(int?BookId) { if (BookId == null) { return(HttpNotFound()); } // Selects the book based on Book.Id var book = booksContext.GetBook((int)BookId); return(View(book)); }