예제 #1
0
        // Helper method that gets our user ID and creates a ThemeParkService with it
        private ThemeParkRatingService GetRatingService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new ThemeParkRatingService(userId);

            return(service);
        }
        // GET: ThemePark/Detail/{id}
        public ActionResult Details(int id)
        {
            var service = new ThemeParkService();
            var model   = service.GetParkByID(id);

            var ratingService = new ThemeParkRatingService(Guid.Parse(User.Identity.GetUserId()));
            var ratings       = ratingService.GetRatingsByParkID(id);

            ViewBag.Ratings = ratings;

            return(View(model));
        }