コード例 #1
0
        //View detail author by ID
        public JsonResult Detail(int id)
        {
            var author     = AuthorDao.GetAuthor(id);
            var authorView = new AuthorViewModel();

            authorView.ListBooksTitle = author.Books.Select(m => m.Title).ToList();
            authorView.AuthorPhone    = author.AuthorPhone;
            authorView.AuthorName     = author.AuthorName;
            authorView.AuthorID       = author.AuthorID;
            authorView.IsActive       = author.IsActive;
            return(Json(authorView, JsonRequestBehavior.AllowGet));
        }