Пример #1
0
        public ActionResult Index()
        {
            var myModel = new AuthIndexModel {
                Authors = _authorService.GetAllAuthors()
                          .Select(x => new AuthorDTO(x)).ToList()
            };

            return(View(myModel));
        }
Пример #2
0
        //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));
        }