示例#1
0
        private static void AddOrder()
        {
            var mainMenuScreen = new MainMenuScreen();
            var coffeeType     = mainMenuScreen.CaptureCoffeeType();

            var coffeeFactory = ServiceLocator.GetService <ICoffeeFactory>();
            var coffee        = coffeeFactory.Create(coffeeType);

            var addOnScreen = new AddOnScreen();

            coffee = addOnScreen.CaptureAddOns(coffee);

            var orderService = ServiceLocator.GetService <IOrderService>();

            orderService.AddToOrder(coffee);
        }