props/Props-Modules/Props.Shop/Ebay/Api/ItemSummary/SearchResultParser.cs
Harrison Deng e0756e0967 Made progress on implementing some shops.
Performed some folder restructuring as well.
2021-07-24 00:03:32 -05:00

29 lines
886 B
C#

using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Props.Shop.Framework;
namespace Props.Shop.Ebay.Api.ItemSummary
{
public class SearchResultParser
{
private dynamic data;
public int BeginIndex => data.offset;
public int EndIndex => BeginIndex + data.limit;
public IEnumerable<ProductListing> ProductListings { get; private set; }
public SearchResultParser(string result)
{
data = JObject.Parse(result);
List<ProductListing> parsed = new List<ProductListing>();
foreach (dynamic itemSummary in data.itemSummaries)
{
ProductListing listing = new ProductListing();
// TODO: Finish parsing the data.
parsed.Add(listing);
}
ProductListings = parsed;
}
}
}