// GET: Movies public IActionResult Index() { var movies = _service.GetMovies(); if (movies == null) { return(NotFound()); } return(View(movies)); }
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)); }
public ActionResult <IEnumerable <MovieDto> > GetMovies() { return(_service.GetMovies() .Select(movie => (MovieDto)movie) .ToList()); }