// GET: Movies public ActionResult Random() { Movie movie = new Movie() { Name = "The Breakfast Club" }; var customers = new List <Customer> { new Customer { Name = "Alecx" }, new Customer { Name = "Tay" }, new Customer { Name = "Ed" }, new Customer { Name = "Michelle" }, new Customer { Name = "Coop" }, new Customer { Name = "Sarah" } }; var viewModel = new RandomMoviewViewModel { Movie = movie, Customers = customers }; return(View(viewModel)); }
//GET: /movies/random public ActionResult Random() { var movie = new Movie() { Name = "Shrek!" , Id = 1 }; var customers = new List <Customer> { new Customer { Name = "" } , new Customer { Name = "" } , new Customer { Name = "" } }; ViewData["Movie"] = movie; ViewBag.Movie = movie; var vieeresult = new ViewResult(); vieeresult.ViewData.Model = movie; var viewmodel = new RandomMoviewViewModel { Movie = movie , Customers = customers }; return(View(viewmodel)); //return new EmptyResult(); }
// GET: Movies/Random public ActionResult Random() { var movie = new Movie() { Name = "Shrek!" }; var customers = new List <Customer> { new Customer { Name = "Customer 1" }, new Customer { Name = "Customer 2" } }; var viewModel = new RandomMoviewViewModel { Movie = movie, Customer = customers }; return(View(viewModel)); }