Пример #1
0
        // GET: Movies
        public IActionResult Index()
        {
            var movies = _service.GetMovies();

            if (movies == null)
            {
                return(NotFound());
            }

            return(View(movies));
        }
Пример #2
0
        public IActionResult Index()
        {
            var movies     = _service.GetMovies();
            var screenings = _service.GetScreenings();
            var today      = _service.GetTodaysScreenings();

            if (movies == null || screenings == null || today == null)
            {
                return(NotFound());
            }

            ViewBag.Movies     = movies;
            ViewBag.Screenings = screenings;
            ViewBag.Today      = today;

            return(View(movies));
        }
Пример #3
0
 public ActionResult <IEnumerable <MovieDto> > GetMovies()
 {
     return(_service.GetMovies()
            .Select(movie => (MovieDto)movie)
            .ToList());
 }