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)); } }
public void Dispose() { //冻结当前管理器对象 OrderSpecificationManagerFactory.FreezeOrderSpecificationManagerObject(this); }