public ActionResult SaveDelete(string id) { var comment = LoadPostComment(id); var post = comment.Post; _postCommentRepository.Delete(comment); _postCommentRepository.SubmitChanges(); if (post != null) { return(RedirectToAction("Detail", "Posts", new { id = post.ID })); } else { return(RedirectToAction("Index")); } }
public IActionResult Delete(int id) { _postCommentRepository.Delete(id); return(NoContent()); }