Ejemplo n.º 1
0
        public async Task <IActionResult> GetListOfBooks()
        {
            try
            {
                var data = await _bookBusiness.GetListOfBooks();

                if (data != null)
                {
                    success = true;
                    message = "List of Books Fetched Successfully";
                    return(Ok(new { success, message, data }));
                }
                else
                {
                    message = "No Data Found";
                    return(NotFound(new { success, message }));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(new { ex.Message }));
            }
        }