public ActionResult AddReview(ReviewViewModel reviewVM) { if (ModelState.IsValid) { reviewVM.PublDate = DateTime.Now; reviewVM.UserEmail = User.Identity.Name; Mapper.Reset(); Mapper.Initialize(cfg => cfg.CreateMap <ReviewViewModel, ReviewDTO>()); var reviewDTO = Mapper.Map <ReviewViewModel, ReviewDTO>(reviewVM); review.SendReview(reviewDTO); } else { return(RedirectToAction("ShowReviews")); } return(RedirectToAction("ShowReviews")); }