public PartialViewResult PostComment(int releaseId, string commentText, int replyId = -1) { IComment comment = CreateComment(releaseId, commentText, replyId); CommentViewModel toReturn = CreateCommentViewModel(commentText); commentLogic.Add(comment); return(PartialView("_PostedComment", toReturn)); }
public IActionResult PostComment(SingleDiscussionViewModel model) { if (!ModelState.IsValid) { return(View(model)); } int id = Convert.ToInt32(User.Claims.Where(c => c.Type == "Id") .Select(c => c.Value).SingleOrDefault()); cLogic.Add(id, model.Entry); return(RedirectToAction("Single", new { model.DiscussionId })); }