public ActionResult Index() { var myModel = new AuthIndexModel { Authors = _authorService.GetAllAuthors() .Select(x => new AuthorDTO(x)).ToList() }; return(View(myModel)); }
//public ActionResult ViewBooksDetail3(int authorId) public ActionResult ViewBooksDetail5(int authorId) { var myModel = new AuthIndexModel { Authors = _authorService.GetAllAuthors().Select(x => new AuthorDTO(x)).ToList(), SelectedBooks = _authorService.GetAllBooksOfAuthor(authorId) .Select(x => new BookDTO(x)).ToList() }; return(View("Index", myModel)); }