Exemplo n.º 1
0
 public static OrderList ReadFromJObject(JObject o)
 {
     return(new OrderList
     {
         List =
             ((IDictionary <string, JToken>)o).ToDictionary(item => int.Parse(item.Key),
                                                            item =>
                                                            Order.ReadFromJObject(item.Value as JObject))
     });
 }
Exemplo n.º 2
0
        public static OrderList ReadFromJObject(JObject o)
        {
            var dic = new Dictionary <int, Order>();

            foreach (var p in o.Properties())
            {
                dic[Convert.ToInt32(p.Name)] = Order.ReadFromJObject(p.Value as JObject);
            }
            return(new OrderList()
            {
                //	List = o.OfType<KeyValuePair<string, JToken>>().ToDictionary(item => int.Parse(item.Key), item => Order.ReadFromJObject(item.Value as JObject))
                List = dic
            });
        }
Exemplo n.º 3
0
        public static OrderList ReadFromJObject(JObject o)
        {
            var r = new OrderList();

            r.List = new Dictionary <int, Order>();
            foreach (var item in o)
            {
                var orderId = int.Parse(item.Key);
                var order   = Order.ReadFromJObject(item.Value as JObject);
                r.List.Add(orderId, order);
            }

            return(r);
        }
Exemplo n.º 4
0
        public static OrderList ReadFromJObject(JObject o)
        {
            var list = new OrderList();

            list.List = new Dictionary <int, Order>();
            foreach (var VARIABLE in o)
            {
                list.List.Add(key: int.Parse(VARIABLE.Key.ToString()), value: Order.ReadFromJObject(VARIABLE.Value as JObject));
            }
            return(list);
            //return new OrderList()
            //           {
            //               List =
            //                   o.OfType<KeyValuePair<string, JToken>>().ToDictionary(item => int.Parse(item.Key),
            //                                                                         item => Order.ReadFromJObject(item.Value as JObject))
            //           };
        }
Exemplo n.º 5
0
        public static OrderList ReadFromJObject(JObject o)
        {
            var orderList = new OrderList()
            {
                List = new Dictionary <int, Order>()
            };
            var res = o.Properties().ToList();

            foreach (JProperty property in res)
            {
                orderList.List.Add(int.Parse(property.Name), Order.ReadFromJObject(property.Value as JObject));
            }

            return(orderList);

            return(new OrderList()
            {
                List = o.OfType <KeyValuePair <string, JToken> >().ToDictionary(item => int.Parse(item.Key), item => Order.ReadFromJObject(item.Value as JObject))
            });
        }
Exemplo n.º 6
0
 public static OrderList ReadFromJObject(JObject o)
 {
     return(new OrderList()
     {
         List = o.OfType <KeyValuePair <string, JToken> >().ToDictionary(item => int.Parse(item.Key), item => Order.ReadFromJObject(item.Value as JObject))
     });
 }