コード例 #1
0
        public IActionResult AuthorDetail(string Yurl)
        {
            Author author = _authorServices.GetAuthorDetails(Yurl);

            return(View(new AuthorDetailModel {
                Author = author,
                Books = author.BookAuthors.Select(i => i.Book).ToList()
            }));
        }
コード例 #2
0
        public IActionResult AuthorDetails(string author)
        {
            if (author == null)
            {
                return(NotFound());
            }
            Author Author = _authorServices.GetAuthorDetails(author);


            var model = new AuthorDetailModel
            {
                Authors  = Author,
                Articles = Author.ArticleAuthors
                           .Select(i => i.Articles).ToList(),
                News = Author.newsAuthors
                       .Select(i => i.News).ToList(),
            };

            return(View(model));
        }