// 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)); }
public ActionResult Get() { try { var _result = _bookBusiness .GetAll() .Parse <Book, BookOutVO>() .ToArray() ; return(Ok(_result)); } catch (Exception ex) { return(this.ReturnActionResult(ex)); } }
public List <BookItem> GetAll() => bookBusiness.GetAll();
public IEnumerable <BookResponseViewModel> GetAll() { var books = _bookBusiness.GetAll(); return(_mapper.Map <IEnumerable <BookResponseViewModel> >(books)); }
// GET: api/Books public IEnumerable <Book> Get() { return(_booksBusiness.GetAll()); }
public IActionResult Get() => Ok(_bookBusiness.GetAll());