protected override async Task<bool> GetDataAsync()
        {
         
            var resource = new ProductResource(Context, DataViewMode.HasValue ? DataViewMode.Value : Api.DataViewMode.Live);
            _results = await resource.GetProductsAsync(startIndex: StartIndex, pageSize: PageSize, sortBy: SortBy, filter: Filter, q: Q, qLimit: QLimit,responseFields:ResponseFields);

            TotalCount = _results.TotalCount;
            PageCount = _results.PageCount;
            PageSize = _results.PageSize;
            return _results.Items != null && _results.Items.Count > 0;
        }
Пример #2
0
 public static List<WishlistItem> GenerateWishlistItemListRandom(ProductCollection products, int numItems)
 {
     var productCode = "";
     var variationKey = "";
     var wishListItemList = GenerateWishlistItemList();
     for (int i = 0; i < numItems; i++)
     {
         //Generate Product
         if (i < products.Items.Count)
         {
             productCode = products.Items[i].ProductCode;
             variationKey = products.Items[i].VariationKey;
         }
         else
         {
             productCode = products.Items[0].ProductCode;
             variationKey = products.Items[0].VariationKey;
         }
         var product = Generator.GenerateConfigurableProduct(productCode, variationKey);
         var wishListItem = Generator.GenerateWishlistItem(product,
         Generator.RandomString(25, Generator.RandomCharacterGroup.AlphaNumericOnly), "high",
             "purchasable", 2, true, true);
         wishListItemList.Add(wishListItem);
     }
     return wishListItemList;
 }