예제 #1
0
        public IActionResult Details(int id)
        {
            var article = _articleData.GetArticle(id);
            //var comments = _commentData.GetComments(id).ToList();

            //var pagedList =  PagingList.Create(comments, 2, page);

            var model = new ArticeViewModel();

            model.Id       = id;
            model.Title    = article.Title;
            model.Author   = article.Author;
            model.Category = article.Category;
            model.Comments = _commentData.GetComments(id).ToList();
            model.Date     = article.Date;
            model.Content  = article.Content;
            ViewData["Id"] = model.Id.ToString();



            return(View(model));
        }
예제 #2
0
 ArticleModel IAricleHandler.GetArticle(string category, string articleId)
 {
     return(_articleData.GetArticle(articleId, ""));
 }