コード例 #1
0
        public ActionResult Index()
        {
            IEnumerable <BookGetViewModel> booksView = _bookService.GetBooks();

            //var x = new AuthorService().GetAuthors();
            //ViewData["Model"] = x;

            return(View(booksView));
        }
コード例 #2
0
        public JsonResult GetBooks()
        {
            var books = _bookService.GetBooks();

            return(Json(books, JsonRequestBehavior.AllowGet));
        }