File tree Expand file tree Collapse file tree 2 files changed +38
-18
lines changed
LibraryManagement.Api/Controllers Expand file tree Collapse file tree 2 files changed +38
-18
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ //-----------------------------------------------------------
2+ // Copyright (c) Coalition of Good-Hearted Engineers
3+ // Free To Use To Build Reliable Library Management Solutions
4+ //-----------------------------------------------------------
5+
6+ using LibraryManagement . Api . Models . Foundations . ReaderBooks ;
7+ using LibraryManagement . Api . Services . Foundations . ReaderBooks ;
8+ using Microsoft . AspNetCore . Mvc ;
9+ using RESTFulSense . Controllers ;
10+
11+ namespace LibraryManagement . Api . Controllers
12+ {
13+ [ ApiController ]
14+ [ Route ( "api/[controller]" ) ]
15+ public class ReaderBooksController : RESTFulController
16+ {
17+ private readonly IReaderBookService readerBookService ;
18+
19+ public ReaderBooksController ( IReaderBookService readerBookService ) =>
20+ this . readerBookService = readerBookService ;
21+
22+ [ HttpGet ( "{readerId}" ) ]
23+ public async ValueTask < ActionResult < ReaderBook > > GetReaderBookByIdAsync ( Guid readerId )
24+ {
25+ try
26+ {
27+ ReaderBook readerBook =
28+ await this . readerBookService . RetrieveReaderBookByIdAsync ( readerId ) ;
29+
30+ return Ok ( readerBook ) ;
31+ }
32+ catch ( Exception exception )
33+ {
34+ return StatusCode ( 500 , exception . Message ) ;
35+ }
36+ }
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments