public IActionResult Delete(ReviewCommentDeleteViewModel viewModel) { ReviewComment comment = reviewCommentService.GetByID(viewModel.ReviewComment.ID); if (comment == null) { return(NotFound()); } reviewCommentService.Delete(comment.ID); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { if (id == 0) { return(NotFound()); } ReviewComment comment = reviewCommentService.GetByID(id); if (comment == null) { return(NotFound()); } ReviewCommentDeleteViewModel viewModel = new ReviewCommentDeleteViewModel() { ReviewComment = comment, Review = comment.Review }; return(View(viewModel)); }