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)) }); }
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 }); }
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); }
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)) // }; }
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)) }); }
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)) }); }