Exemplo n.º 1
0
        public ActionResult CreateAPizza(CreateAPizzaViewModel vm)
        {
            var repo = new PizzaTypeRepository();
            repo.Add(new PizzaType
            {
                Name = vm.Name
            });

            return RedirectToAction("Pizzas");
        }
Exemplo n.º 2
0
        public ActionResult CreateAPizza(CreateAPizzaViewModel vm)
        {
            var repo = new PizzaTypeRepository();

            repo.Add(new PizzaType
            {
                Name = vm.Name
            });

            return(RedirectToAction("Pizzas"));
        }
Exemplo n.º 3
0
        public ActionResult Pizzas()
        {
            var repo = new PizzaTypeRepository();
            var pizzas = repo.GetPizzaTypes();

            var vm = new PizzasViewModel();
            vm.CountOfPizzas = pizzas.Count;
            vm.PizzaTypes = pizzas;

            return View(vm);
        }
Exemplo n.º 4
0
        public ActionResult Pizzas()
        {
            var repo   = new PizzaTypeRepository();
            var pizzas = repo.GetPizzaTypes();

            var vm = new PizzasViewModel();

            vm.CountOfPizzas = pizzas.Count;
            vm.PizzaTypes    = pizzas;

            return(View(vm));
        }