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 })); } }
public async Task <Book> Get(int id) { return(await business.GetBook(id)); }