コード例 #1
0
        public IActionResult Edit(ReviewCommentEditViewModel viewModel)
        {
            ReviewComment comment = reviewCommentService.GetByID(viewModel.ReviewComment.ID);

            comment.Body = viewModel.ReviewComment.Body;

            reviewCommentService.Update(comment);

            return(RedirectToAction("Details", comment));
        }
コード例 #2
0
        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));
        }