示例#1
0
        // GET: Movies
        public ActionResult Random()
        {
            var movie = new Movie()
            {
                ID   = 1,
                Name = "Die Hard 1"
            };
            var customers = new List <Customer>();

            customers.Add(new Customer()
            {
                ID = 1, Name = "Rahat"
            });
            customers.Add(new Customer()
            {
                ID   = 1,
                Name = "Sanju-Irani"
            });

            var rvm = new RandomMovieVM()
            {
                Movie     = movie,
                Customers = customers
            };

            return(View(rvm));
        }
示例#2
0
        // GET: Movies
        public ActionResult Random()
        {
            var movie = new Movie {
                Name = "Shrek"
            };
            var customers = new List <Customer>
            {
                new Customer {
                    Name = "Cust 1"
                },
                new Customer {
                    Name = "Cust 2"
                }
            };

            var viewModel = new RandomMovieVM
            {
                Movie     = movie,
                Customers = customers
            };

            return(View(viewModel));
        }