Beispiel #1
0
        public IActionResult Get(int skip = 0, int limit = 100000, int cluster = -1, int movie = -1)
        {
            if (limit <= 0)
            {
                var error = new Error()
                {
                    message = "Limit must be greater than 0"
                };
                return(StatusCode(400, error));
            }

            ICollection <ShowtimeDTO> showtimes;

            if (cluster != -1)
            {
                if (movie != -1)
                {
                    showtimes = showtimeRepository.GetShowtimesByClusterIdAndMovieId(cluster, movie);
                }
                else
                {
                    showtimes = showtimeRepository.GetShowtimesByClusterId(cluster);
                }
            }
            else
            {
                showtimes = showtimeRepository.GetAllShowtimes(skip, limit);
            }
            return(Ok(showtimes));
        }