private AmazonWishlistItems ConvertAmazonWishlist(string content) { AmazonWishlistItems result = new AmazonWishlistItems(); using (StringReader sr = new StringReader(content)) { XmlSerializer ser = new XmlSerializer(typeof(ItemLookupResponse)); ItemLookupResponse data = (ItemLookupResponse)ser.Deserialize(sr); if (data == null || data.Items == null || data.Items.Length == 0) { return(result); } if (asinIds.Length > 0) { result.Ids = asinIds; } foreach (Item item in data.Items) { result.Items.Add(service.ConvertAmazonProduct(item)); } } return(result); }
private List <AmazonProduct> ConvertAmazonSearch(string content) { List <AmazonProduct> list = new List <AmazonProduct>(); using (StringReader sr = new StringReader(content)) { XmlSerializer ser = new XmlSerializer(typeof(ItemSearchResponse)); ItemSearchResponse data = (ItemSearchResponse)ser.Deserialize(sr); if (data == null || data.Items == null || data.Items.Length == 0) { return(list); } foreach (Item item in data.Items) { list.Add(service.ConvertAmazonProduct(item)); } } return(list); }