void CheckoutRecommendations() { var client = new RecommendationsApi(AccountKey, BaseUri); var recommendations = client.GetRecommendations(ModelId, BuildId, Cart[0].ItemId, 3); Recommendations = new ObservableCollection <Inventory>(); foreach (var rec in recommendations.RecommendedItemSetInfo) { foreach (var item in rec.Items) { Recommendations.Add(new Inventory { ItemId = item.Id, Name = item.Name, Description = rec.Rating.ToString() }); } } }
async Task CheckoutRecommendations() { Task.Run(() => { var client = new RecommendationsApi(Constants.AccountKey, Constants.BaseUri); var recommendations = client.GetRecommendations(Constants.ModelId, Constants.BuildId, Cart[0].ItemId, 3); foreach (var rec in recommendations.RecommendedItemSetInfo) { foreach (var item in rec.Items) { Recommendations.Add(new Inventory { ItemId = item.Id, Name = item.Name, Description = rec.Rating.ToString() }); } } }); }
public void Init() { instance = new RecommendationsApi(); }