// GET: All Book
        public JsonResult GetAllBook()
        {
            var         list     = bookBusiness.GetAll().ToList();
            List <Book> listBook = new List <Book>();

            for (int i = 0; i < list.Count(); i++)
            {
                Book book = new Book();
                book.BookID        = list.ElementAt(i).BookID;
                book.Title         = list.ElementAt(i).Title;
                book.PublisherDate = list.ElementAt(i).PublisherDate;

                string dateTime = Convert.ToString(list.ElementAt(i).PublisherDate);
                book.dateTime   = dateTime;
                book.Publisher  = list.ElementAt(i).Publisher;
                book.PageNumber = list.ElementAt(i).PageNumber;

                listBook.Add(book);
            }

            return(Json(listBook, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
 public ActionResult Get()
 {
     try
     {
         var _result = _bookBusiness
                       .GetAll()
                       .Parse <Book, BookOutVO>()
                       .ToArray()
         ;
         return(Ok(_result));
     }
     catch (Exception ex)
     {
         return(this.ReturnActionResult(ex));
     }
 }
Exemple #3
0
 public List <BookItem> GetAll() => bookBusiness.GetAll();
Exemple #4
0
        public IEnumerable <BookResponseViewModel> GetAll()
        {
            var books = _bookBusiness.GetAll();

            return(_mapper.Map <IEnumerable <BookResponseViewModel> >(books));
        }
Exemple #5
0
 // GET: api/Books
 public IEnumerable <Book> Get()
 {
     return(_booksBusiness.GetAll());
 }
Exemple #6
0
 public IActionResult Get() => Ok(_bookBusiness.GetAll());