Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var manager   = OrderSpecificationManagerFactory.CreateNewOrderSpecificationManager();
            var orderList = new List <Order>
            {
                new Order()
                {
                    Customer = new Customer()
                    {
                        CustomerType = CustomerType.Vip
                    }
                },
                new Order()
                {
                    Customer = new Customer()
                    {
                        CustomerType = CustomerType.Normal
                    }
                }
            };
            OrderBusiness business = new OrderBusiness(manager);

            using (manager)
            {
                orderList.ForEach(order => business.SubmitOrder(order));
            }
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     //冻结当前管理器对象
     OrderSpecificationManagerFactory.FreezeOrderSpecificationManagerObject(this);
 }