Ejemplo n.º 1
0
        public IActionResult New(InvitesReviewViewModel model)
        {
            var review = model.NewReview;
            int userId = Convert.ToInt32(Convert.ToString(User.Claims.Where(claim => claim.Type == "Id").Select(claim => claim.Value).SingleOrDefault()));

            _reviewLogic.AddReview(review, userId);
            var categories = model.Categories;

            foreach (var category in categories)
            {
                _reviewLogic.AddRatingToReview(category, review.Id);
            }

            return(RedirectToAction("Index", "Home"));
        }