コード例 #1
0
        public void CreateOrder(IOrderState orderState)
        {
            var order = orderState.State();

            //Create order
            Console.WriteLine("Order created");
        }
コード例 #2
0
        public void ChangeState(IOrderState orderState)
        {
            if (!orderState.CanDo())
            {
                throw new NotImplementedException("Cannot");
            }

            var order = orderState.State();

            //Save order
            Console.WriteLine("Save order");
        }