public Order Fetch(int id) { var obj = (Order)MethodCaller.CreateInstance(typeof(Order)); var item = (from r in MockDb.Orders where r.Id == id select r).First(); using (BypassPropertyChecks(obj)) { LoadProperty(obj, Order.IdProperty, item.Id); LoadProperty(obj, Order.CustomerNameProperty, item.CustomerName); var lif = new LineItemFactory(); LoadProperty(obj, Order.LineItemsProperty, lif.FetchItems(id)); } MarkOld(obj); return obj; }
public Order Fetch(int id) { var obj = (Order)MethodCaller.CreateInstance(typeof(Order)); var item = (from r in MockDb.Orders where r.Id == id select r).First(); using (BypassPropertyChecks(obj)) { LoadProperty(obj, Order.IdProperty, item.Id); LoadProperty(obj, Order.CustomerNameProperty, item.CustomerName); var lif = new LineItemFactory(); LoadProperty(obj, Order.LineItemsProperty, lif.FetchItems(id)); } MarkOld(obj); return(obj); }
public Order Fetch(int id) { var obj = ApplicationContext.CreateInstanceDI <Order>(); var item = (from r in MockDb.Orders where r.Id == id select r).First(); using (BypassPropertyChecks(obj)) { LoadProperty(obj, Order.IdProperty, item.Id); LoadProperty(obj, Order.CustomerNameProperty, item.CustomerName); var lif = new LineItemFactory(ApplicationContext); LoadProperty(obj, Order.LineItemsProperty, lif.FetchItems(id)); } MarkOld(obj); return(obj); }