Esempio n. 1
0
        public List <CinemaSeat> GetSeatingLayoutByShow(long showID)
        {
            Cinema cinema = _mapper.Map <Cinema>(_cinemaRepository.GetCinemaByID(showID));

            if (cinema != null)
            {
                List <CinemaSeat> cinemaSeats  = _mapper.Map <List <CinemaSeat> >(_cinemaSeatingRepository.GetCinemasSeatingByLayoutID(cinema.LayoutID));
                List <long>       reservations = GetReservedSeatsByShow(showID);
                cinemaSeats.ForEach(seat =>
                {
                    seat.IsBooked = reservations.Contains(seat.ID);
                });
                return(cinemaSeats);
            }
            return(null);
        }