Ejemplo n.º 1
0
        // GET: ShoppingList
        public ActionResult Index()
        {
            ShoppingListService service = new ShoppingListService();

            IndexViewModel vm = new IndexViewModel
            {
                Customers = service.GetItems()
            };

            return(View(vm));
        }
        // GET: ShoppingList
        public ActionResult Index()
        {
            IndexViewModel vm = new IndexViewModel
            {
                FirstName = "Nick",
                LastName  = "Brittain",
                Products  = _service.GetItems()
            };

            vm.Total = vm.Products.Sum(p => p.Price);

            return(View(vm));
        }
        // GET: ShoppingList
        public ActionResult Index()
        {
            IndexViewModel vm = new IndexViewModel
            {
                FirstName    = "Danielle",
                LastName     = "Frederick",
                ShoppingCart = _service.GetItems()
            };

            vm.Total = vm.ShoppingCart.Sum(p => p.Price);

            return(View(vm));
        }