public IActionResult DeleteComment(int id) { var comment = _posts.GetCommentById(id); var post = _posts.GetById(comment.Post.Id); if (_posts.DeleteComment(comment)) { return(RedirectToAction("Detail", new { post.Id })); } return(BadRequest()); }