Esempio n. 1
0
        public List <Movie> GetMoviesByCity(long cityID)
        {
            List <Movie>  movies           = _mapper.Map <List <Movie> >(_movieRepository.GetMovies());
            List <Cinema> cinemasInTheCity = _mapper.Map <List <Cinema> >(_cinemaRepository.GetCinemasByCity(cityID));
            List <Show>   showsInTheCity   = _mapper.Map <List <Show> >(_showsRepository.GetShowsByCinemas(cinemasInTheCity.Select(cinema => cinema.ID).ToList()));

            movies = movies.Where(movie => showsInTheCity.Select(show => show.MovieID).Contains(movie.ID)).ToList();
            return(movies);
        }