public ActionResult Delete(int articleId) { Article article = repository.Articles.FirstOrDefault(a => a.ArticleID == articleId); if (article != null) { repository.DeleteArticle(article); TempData["message"] = string.Format("{0} was deleted", article.Title); } return(RedirectToAction("Index")); }