Exemplo n.º 1
0
        public async Task <ActionResult> Add(string reviewId, string revisionId, string elementId, string commentText)
        {
            var comment = new CommentModel();

            comment.TimeStamp  = DateTime.UtcNow;
            comment.ReviewId   = reviewId;
            comment.RevisionId = revisionId;
            comment.ElementId  = elementId;
            comment.Comment    = commentText;

            await _commentsManager.AddCommentAsync(User, comment);

            return(await CommentPartialAsync(reviewId, comment.ElementId));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Add(string reviewId, string revisionId, string elementId, string commentText)
        {
            var comment = new CommentModel();

            comment.TimeStamp  = DateTime.UtcNow;
            comment.ReviewId   = reviewId;
            comment.RevisionId = revisionId;
            comment.ElementId  = elementId;
            comment.Comment    = commentText;

            await _commentsManager.AddCommentAsync(User, comment);

            var review = await _reviewManager.GetReviewAsync(User, reviewId);

            if (review != null)
            {
                await _notificationManager.SubscribeAsync(review, User);
            }
            return(await CommentPartialAsync(reviewId, comment.ElementId));
        }