public async Task<ActionResult> SaveMessage(Comment comment, string returnUrl = "~/Views/Comment/Contact.cshtml") { if (ModelState.IsValid) { await _iCommentBL.AddComment(comment); } else { ModelState.AddModelError("", "All fields are mandatory"); } return View(returnUrl); }
public async Task AddComment(Comment comment) { await _iCommentDal.InsertAsync(comment); }
public async Task<ActionResult> AddComment(Comment comment) { await _iCommentBL.AddComment(comment); List<Comment> comms = (await _iCommentBL.GetCommentsForArticle(comment.ArticleId)).ToList(); return PartialView("~/Views/Comment/Comments.cshtml", comms); }