예제 #1
0
        private static ItemRecentSale ReadItemRecentSale(dynamic item)
        {
            double?  price     = item.price ?? null;
            double?  wearValue = item.wear_value ?? null;
            DateTime?soldAt    = null;

            if (item.sold_at != null)
            {
                soldAt = DateTimeExtension.FromUnixTime((long)item.sold_at);
            }

            ItemRecentSale recentSaleItem = new ItemRecentSale(price, wearValue, soldAt);

            return(recentSaleItem);
        }
예제 #2
0
        private static List <ItemRecentSale> ReadItemRecentSales(string result)
        {
            dynamic responseServerD = JsonConvert.DeserializeObject(result);
            dynamic salesD          = responseServerD.data.sales;

            List <ItemRecentSale> itemRecentSales = new List <ItemRecentSale>();

            if (salesD != null)
            {
                foreach (dynamic item in salesD)
                {
                    ItemRecentSale recentSaleItem = ReadItemRecentSale(item);
                    itemRecentSales.Add(recentSaleItem);
                }
            }

            return(itemRecentSales);
        }