Beispiel #1
0
        public ActionResult DeletePostForAuthor(Guid authorId, Guid postId)
        {
            if (!_discussionWebRepository.AuthorExists(authorId))
            {
                return(NotFound());
            }

            var postForAuthorFromRepo = _discussionWebRepository.GetPost(authorId, postId);

            if (postForAuthorFromRepo == null)
            {
                return(NotFound());
            }

            _discussionWebRepository.DeletePost(postForAuthorFromRepo);
            _discussionWebRepository.Save();

            return(NoContent());
        }