Esempio n. 1
0
        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()
                    });
                }
            }
        }
Esempio n. 2
0
        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()
                        });
                    }
                }
            });
        }
Esempio n. 3
0
 public void Init()
 {
     instance = new RecommendationsApi();
 }