We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db36635 commit b9ea0f2Copy full SHA for b9ea0f2
LibraryManagement.Api/Controllers/BooksController.cs
@@ -53,5 +53,24 @@ public async ValueTask<ActionResult<Book>> PostBookAsync(Book book)
53
return InternalServerError(bookServiceException.InnerException);
54
}
55
56
+
57
+ [HttpGet("all")]
58
+ public ActionResult<IQueryable<Book>> GetAllBooks()
59
+ {
60
+ try
61
62
+ IQueryable<Book> allBooks = this.bookService.RetrieveAllBooks();
63
64
+ return Ok(allBooks);
65
+ }
66
+ catch (BookDependencyException bookDependencyException)
67
68
+ return InternalServerError(bookDependencyException.InnerException);
69
70
+ catch (BookServiceException bookServiceException)
71
72
+ return InternalServerError(bookServiceException.InnerException);
73
74
75
76
0 commit comments