Connectster.Shopify.ShopifyCommunicator.GetAllProducts C# (CSharp) Method

GetAllProducts() public method

public GetAllProducts ( ShopifyStoreAuth storeAuth ) : List
storeAuth ShopifyStoreAuth
return List
        public List<ShopifyProduct> GetAllProducts(ShopifyStoreAuth storeAuth)
        {
            var returnList = new List<ShopifyProduct>(250);
            int pageNumber = 1;

            while (true)
            {
                List<ShopifyProduct> tempList = GetPageOfProducts(storeAuth, 250, pageNumber++);
                if (tempList != null)
                {
                    returnList = returnList.Union(tempList).ToList();
                    if (tempList.Count < 250)
                    {
                        break;
                    }
                }
            }

            return returnList;
        }