Exemplo n.º 1
0
        public IActionResult DeleteComment(Guid postid, Guid commentid)
        {
            CommentSaveState state = _blogManager.DeleteComment(postid.ToString(), commentid.ToString());

            if (state == CommentSaveState.Failed)
            {
                return(StatusCode(500));
            }

            if (state == CommentSaveState.NotFound)
            {
                return(NotFound());
            }

            return(Ok());
        }
Exemplo n.º 2
0
        public IActionResult DeleteComment(Guid postid, Guid commentid)
        {
            var state = blogManager.DeleteComment(postid.ToString(), commentid.ToString());

            if (state == NBR.CommentSaveState.Failed)
            {
                logger.LogError(new EventDataItem(EventCodes.Error, null, "Delete comment failed: {0}", postid.ToString()));
                return(StatusCode(500));
            }

            if (state == NBR.CommentSaveState.NotFound)
            {
                return(NotFound());
            }

            logger.LogInformation(new EventDataItem(EventCodes.CommentDeleted, null, "Comment deleted on: {0}", postid.ToString()));

            BreakSiteCache();

            return(Ok());
        }