public IActionResult Edit(ReviewCommentEditViewModel viewModel) { ReviewComment comment = reviewCommentService.GetByID(viewModel.ReviewComment.ID); comment.Body = viewModel.ReviewComment.Body; reviewCommentService.Update(comment); return(RedirectToAction("Details", comment)); }
public IActionResult Edit(int id) { if (id == 0) { return(NotFound()); } ReviewComment comment = reviewCommentService.GetByID(id); if (comment == null) { return(NotFound()); } ReviewCommentEditViewModel viewModel = new ReviewCommentEditViewModel() { ReviewComment = comment, Review = comment.Review }; return(View(viewModel)); }