Exemplo n.º 1
0
        public ActionResult SubmitPostComments(Guid postId)
        {
            CommentReviewViewModel commentVm = new CommentReviewViewModel()
            {
                PostId = postId
            };

            return(this.PartialView("_SubmitPostComments", commentVm));
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        public ActionResult PostComment(CommentReviewViewModel commentVm)
        {
            this.commentService.CreateComment(commentVm);

            return(this.RedirectToAction("Post", "Review", new { area = "", postId = commentVm.PostId }));
        }