예제 #1
0
        public IActionResult CoffeeDI()
        {
            var vm = new CoffeeVm();

            vm.CoffeeCup = _coffeeCup;

            return(View(vm));
        }
예제 #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));
        }