private static RelistedItem ReadRelistedItem(dynamic item) { string itemId = item.item_id ?? null; bool? instantSale = item.instant_sale ?? null; double? price = item.price ?? null; DateTime?withdrawableAt = null; if (item.withdrawable_at != null) { withdrawableAt = DateTimeExtension.FromUnixTime((long)item.withdrawable_at); } RelistedItem relistedItem = new RelistedItem(itemId, instantSale, price, withdrawableAt); return(relistedItem); }
private static List <RelistedItem> ReadRelistedItems(string result) { dynamic responseServerD = JsonConvert.DeserializeObject(result); dynamic itemsD = responseServerD.data.items; List <RelistedItem> relistedItems = new List <RelistedItem>(); if (itemsD != null) { foreach (dynamic item in itemsD) { RelistedItem relistedItem = ReadRelistedItem(item); relistedItems.Add(relistedItem); } } return(relistedItems); }