Пример #1
0
        public IActionResult Create(ReviewOnProduct review)
        {
            //need to change review to type Review
            Review newReview = new Review();

            newReview.ReviewId  = review.ReviewId;
            newReview.Author    = review.Author;
            newReview.Content   = review.Content;
            newReview.Rating    = review.Rating;
            newReview.ProductId = review.ProductId;


            //need to pass in object of type Review
            reviewRepo.Save(newReview);

            return(RedirectToAction("Details", "Products", new { id = review.ProductId }));
        }
Пример #2
0
        public IActionResult Create(int productId)
        {
            ReviewOnProduct reviewonproduct = new ReviewOnProduct(productId);

            return(View(reviewonproduct));
        }