Exemple #1
0
        public IActionResult Delete(ReviewCommentDeleteViewModel viewModel)
        {
            ReviewComment comment = reviewCommentService.GetByID(viewModel.ReviewComment.ID);

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

            reviewCommentService.Delete(comment.ID);

            return(RedirectToAction("Index"));
        }
Exemple #2
0
        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));
        }