public ActionResult <Post> DeletePost(int id) { var post = _postData.GetPostById(id); if (post == null) { return(NotFound()); } _postData.DeletePost(id); _postData.DeleteComment(id); _postData.Commit(); return(post); }
public IActionResult Delete(int CommentId, int PostId) { pd.DeleteComment(CommentId); pd.Commit(); return(RedirectToAction("Details", "Home", new { PostId })); }
public IActionResult OnPostDeleteComment(int commentId) { _postData.DeleteComment(commentId); return(RedirectToPage()); }