????????????????????????AddOrder???????в???????涼?????????Order testOrder = new Order() ?????????????????Order???????????????????????????????????????????в?????????????м??????ζ???????в?????????????N????????????????????????
??????????????????????????????????????????????????????п?????????????????????Σ?
????????????幹??
????Order testOrder = this.InitNormalOrder();
????Order testOrder = this.InitNormalOrder();
????????OrderId????????????????????String.Empty??
????<STRONG>Order testOrder = this.InitNormalOrder();
????testOrder.OrderId = string.Empty; </STRONG>
????Order testOrder = this.InitNormalOrder();
????testOrder.OrderId = string.Empty; ????????????γ???仯????????????????????????????Щ?????????????????????????????????е???????????????????????????
????3??LINQ?????????д???????????LINQд???????Function??????LINQ?????У?
?????????LINQ????д???????????????????????????????????LINQд??????????????????????????????????????????????????????????????????????????????????????У????????????????????????????????LINQ?????滻???????Function??????
????LINQ???????????????????????????????????Linq to Object?У?????????Linq to Provider?ж?????LINQ????????????????????????????Service????LINQ????????????????????????????б?д????????LINQ?д???????ж????????????????????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????ж??????????????OrderService?????
????public Order SelectByOrderId(string orderId)
????{
????List<Order> orders = new List<Order>()
????{
????new Order(){ OrderId="123"?? SubmitDT=DateTime.Now.AddDays(1)}??
????new Order(){ OrderId="234"}
????};
????var list = orders.Where(order => order.OrderId == orderId && order.SubmitDT > DateTime.Now);
????if (list.Count() > 0)
????return list.ToList()[0];
????return null;
????}
????public Order SelectByOrderId(string orderId)
????{
????List<Order> orders = new List<Order>()
????{
????new Order(){ OrderId="123"?? SubmitDT=DateTime.Now.AddDays(1)}??
????new Order(){ OrderId="234"}
????};
????var list = orders.Where(order => order.OrderId == orderId && order.SubmitDT > DateTime.Now);
????if (list.Count() > 0)
????return list.ToList()[0];
????return null;
????}

???????????????OrderId???Order??????????????????????????????????????????????????Where??????????????????????????Order????????????Where?е?????????????????????????????????????SubmitDT?????????????????????к?????????????ж??????????????????????????????????????????б?????????????????
????public Order SelectByOrderId(string orderId)
????{
????List<Order> orders = new List<Order>()
????{
????new Order(){ OrderId="123"?? SubmitDT=DateTime.Now.AddDays(1)}??
????new Order(){ OrderId="234"}
????};
????var list = orders.Where(order => IfOrderSubmitAndOrderId(order?? orderId));
????if (list.Count() > 0)
????return list.ToList()[0];
????return null;
????}
????private bool IfOrderSubmitDt(Order order)
????{
????return order.SubmitDT > DateTime.Now;
????}
????private bool IfOrderSubmitAndOrderId(Order order?? string orderId)
????{
????return order.OrderId == orderId && this.IfOrderSubmitDt(order);
????}
????public Order SelectByOrderId(string orderId)
????{
????List<Order> orders = new List<Order>()
????{
????new Order(){ OrderId="123"?? SubmitDT=DateTime.Now.AddDays(1)}??
????new Order(){ OrderId="234"}
????};
????var list = orders.Where(order => IfOrderSubmitAndOrderId(order?? orderId));
????if (list.Count() > 0)
????return list.ToList()[0];
????return null;
????}
????private bool IfOrderSubmitDt(Order order)
????{
????return order.SubmitDT > DateTime.Now;
????}
????private bool IfOrderSubmitAndOrderId(Order order?? string orderId)
????{
????return order.OrderId == orderId && this.IfOrderSubmitDt(order);
????}

?????????????????????е????????????????????????????????????????????????????????????????????????Щ??仯??????????????????
??????????????????????ü?????????????????????????????????????????????е??????????????????