Пример #1
0
        public ActionResult DeleteComment(int commentId, string gameKey)
        {
            var comment = _commentManager.GetById(commentId);

            comment.IsDeleted = true;
            _commentManager.EditComment(comment);

            var childComments = _commentManager.FindByParentId(comment.Id).Where(c => c.IsQuote);

            childComments.ForEach(c => c.Quote = messageForDeletedQuote);
            childComments.ForEach(c => _commentManager.EditComment(c));

            return(RedirectToAction("GetAllCommentsByGameKey", "Comment", new { gameKey }));
        }