Exemplo n.º 1
0
        public IActionResult CoffeeDI()
        {
            var vm = new CoffeeVm();

            vm.CoffeeCup = _coffeeCup;

            return(View(vm));
        }
Exemplo n.º 2
0
        public IActionResult Coffee()
        {
            var        vm      = new CoffeeVm();
            ICreamer   creamer = new Cream();
            ISweetener sugar   = new Sugar();

            vm.CoffeeCup = new CoffeeCup(creamer, sugar);

            return(View(vm));
        }