Esempio n. 1
0
 public IActionResult GetBooks()
 {
     try
     {
         var result = business.GetBook();
         if (result != null)
         {
             return(Ok(new { Status = true, Message = "All Books Retrived Successfully", Data = result }));
         }
         return(BadRequest(new { Status = false, Message = "Error While Retriving Books!!!" }));
     }
     catch (Exception e)
     {
         return(NotFound(new { Status = false, Message = e.Message }));
     }
 }
Esempio n. 2
0
 public async Task <Book> Get(int id)
 {
     return(await business.GetBook(id));
 }