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)); }
public ActionResult ArticleDetail(int articleId) { var article = GetArticleById(articleId); ArticleDetailPageViewModel viewModel = new ArticleDetailPageViewModel { Article = article }; return(View(viewModel)); }