public ActionResult SubmitPostComments(Guid postId) { CommentReviewViewModel commentVm = new CommentReviewViewModel() { PostId = postId }; return(this.PartialView("_SubmitPostComments", commentVm)); }
public void CreateComment(CommentReviewViewModel commentVm) { var comment = new Comment() { Id = Guid.NewGuid(), Content = commentVm.Content, CreatorId = commentVm.CreatorId, PostId = commentVm.PostId, CreatedOn = this.dateTimeProvider.Now() }; this.context.Comments.Add(comment); this.context.SaveChanges(); }
public ActionResult PostComment(CommentReviewViewModel commentVm) { this.commentService.CreateComment(commentVm); return(this.RedirectToAction("Post", "Review", new { area = "", postId = commentVm.PostId })); }