Exemplo n.º 1
0
        public ActionResult Details(int id)
        {
            DetailsViewModel viewModel = new DetailsViewModel();

            viewModel.Gig = gigRepository.GetGigWithArtistAndGenre(id);

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

                viewModel.Attendance = attendanceRepository.GetAttendance(userId, id) != null;
                viewModel.Following  = followingRepository.GetFollowing(userId, viewModel.Gig.ArtistId) != null;
            }
            else
            {
                viewModel.Attendance = false;
                viewModel.Following  = false;
            }


            return(View(viewModel));
        }