Esempio n. 1
0
        /// <summary>
        /// Gets a list of up to 250 smart collections.
        /// </summary>
        /// <param name="filterOptions">Options for filtering the result.</param>
        public virtual async Task <IEnumerable <ShopifySmartCollection> > ListAsync(ShopifySmartCollectionFilter filterOptions = null)
        {
            var req = RequestEngine.CreateRequest($"smart_collections.json", Method.GET, "smart_collections");

            if (filterOptions != null)
            {
                req.Parameters.AddRange(filterOptions.ToParameters(ParameterType.GetOrPost));
            }

            return(await RequestEngine.ExecuteRequestAsync <List <ShopifySmartCollection> >(_RestClient, req));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets a count of all smart collections on the store.
        /// </summary>
        /// <param name="filterOptions">Options for filtering the count.</param>
        public virtual async Task <int> CountAsync(ShopifySmartCollectionFilter filterOptions = null)
        {
            var req = RequestEngine.CreateRequest("smart_collections/count.json", Method.GET, "count");

            if (filterOptions != null)
            {
                req.Parameters.AddRange(filterOptions.ToParameters(ParameterType.GetOrPost));
            }

            return(await RequestEngine.ExecuteRequestAsync <int>(_RestClient, req));
        }