Beispiel #1
0
        public ActionResult Details(int id)
        {
            var gig = _gigRepository.GetSingleGig(id);

            if (gig == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new GigDetailsViewModel {
                Gig = gig
            };

            if (User.Identity.IsAuthenticated)
            {
                var userId = User.Identity.GetUserId();

                viewModel.isAttending = _attendanceRepository.GetAttendance(userId, gig.Id) != null;
                viewModel.isFollowing = _attendanceRepository.GetFollowing(userId, gig.ArtistId) != null;
            }

            return(View(viewModel));
        }