Beispiel #1
0
        public ActionResult MoviesList()
        {
            var movies = _context.Movies.Include(c => c.Genre).ToList();

            var viewModel = new MoviesListViewModel
            {
                Movies = movies
            };

            return(View(viewModel));
        }
Beispiel #2
0
        public ActionResult MoviesList()
        {
            var movies = new List <Movie>
            {
                new Movie {
                    Id = 1, Name = "Shrek!", Year = 2001
                },
                new Movie {
                    Id = 2, Name = "Wall-e", Year = 2008
                }
            };

            var viewModel = new MoviesListViewModel()
            {
                Movies = movies
            };

            return(View(viewModel));
        }
Beispiel #3
0
        public ActionResult Index()
        {
            var movies = new List <Movie>
            {
                new Movie {
                    Id = 1, Name = "Faustão e Malandro"
                },
                new Movie {
                    Id = 2, Name = "A Lagoa Azul 2"
                }
            };

            var moviesList = new MoviesListViewModel
            {
                Movies = movies
            };

            return(View(moviesList));
        }