public ActionResult CommentForm(Comment comment) { if (!ModelState.IsValid) { return(View(comment)); } bl.AddComment(comment); TempData["Message"] = "Hurray! Your comment is added!"; return(RedirectToAction("Article", "Article", new { articleId = Convert.ToInt32(Session["ArticleId"]) })); }
public void AddComment(int postId, string text) { var bl = new BusinessLogic(); bl.AddComment(postId, text, int.Parse(User.Identity.Name)); }