Esempio n. 1
0
        // 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));
        }
Esempio n. 2
0
 public ActionResult Get()
 {
     try
     {
         var _result = _bookBusiness
                       .GetAll()
                       .Parse <Book, BookOutVO>()
                       .ToArray()
         ;
         return(Ok(_result));
     }
     catch (Exception ex)
     {
         return(this.ReturnActionResult(ex));
     }
 }
Esempio n. 3
0
 public List <BookItem> GetAll() => bookBusiness.GetAll();
Esempio n. 4
0
        public IEnumerable <BookResponseViewModel> GetAll()
        {
            var books = _bookBusiness.GetAll();

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