コード例 #1
0
        // GET: Articles/Details/5
        public ActionResult Details(int?id)
        {
            ViewModelResult model = new ViewModelResult();

            try
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                CommentList cmtList  = new CommentList();
                var         comments = cmtList.getListComment(id);
                ArticleList art      = new ArticleList();
                var         details  = art.getDetailArticle(id);
                model = new ViewModelResult {
                    articleDetail = details, listComment = comments
                };
            }

            catch (Exception e)
            {
                CommonUse.WriteLogError(e);
            }


            return(View(model));
        }