示例#1
0
        public ActionResult EditArticle(int articleId)
        {
            var db      = new ArticlesDb();
            var article = db.Articles.Where(x => x.Id == articleId).FirstOrDefault();
            ArticleDetailPageViewModel viewModel = new ArticleDetailPageViewModel
            {
                Article = article
            };

            return(View(viewModel));
        }
示例#2
0
        public ActionResult ArticleDetail(int articleId)

        {
            var article = GetArticleById(articleId);

            ArticleDetailPageViewModel viewModel = new ArticleDetailPageViewModel
            {
                Article = article
            };

            return(View(viewModel));
        }