public ActionResult GetReview(MentorReviewJsonModel reviewJsonModel) { var reviewModel = _reviewMapper.JsonToBLModel(reviewJsonModel); _reviewProvider.AddMentorReview(reviewModel); return(Content("Отзыв успешно создан")); }
public Review JsonToBLModel(MentorReviewJsonModel reviewJsonModel) { var review = _mapper.Map <MentorReviewJsonModel, Review>(reviewJsonModel); review.Grades = reviewJsonModel.SkillGrades .Select(g => _mapper.Map <GradeViewModel, Grade>(g)) .ToList(); review.Grades.Add(new Grade { Review = review, Comment = reviewJsonModel.WorkComment }); return(review); }