示例#1
0
        /// <summary>
        /// default: 50
        /// Gets a list of up to 250 custom collections for the corresponding productId
        /// </summary>
        /// <param name="filter">The <see cref="ShopifyCustomCollection"/>. used to filter results</param>
        /// <returns></returns>
        public virtual async Task <IEnumerable <ShopifyCustomCollection> > ListAsync(ShopifyCustomCollectionFilter filter = null)
        {
            IRestRequest req = RequestEngine.CreateRequest("/custom_collections.json", Method.GET, "custom_collections");

            //Add optional parameters to request
            if (filter != null)
            {
                req.Parameters.AddRange(filter.ToParameters(ParameterType.GetOrPost));
            }

            return(await RequestEngine.ExecuteRequestAsync <List <ShopifyCustomCollection> >(_RestClient, req));
        }
示例#2
0
        /// <summary>
        /// Gets a count of all of the custom collections
        /// </summary>
        /// <returns>The count of all collects for the shop.</returns>
        public virtual async Task <int> CountAsync(ShopifyCustomCollectionFilter options = null)
        {
            IRestRequest req = RequestEngine.CreateRequest("custom_collections/count.json", Method.GET, "count");

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

            JToken responseObject = await RequestEngine.ExecuteRequestAsync(_RestClient, req);

            return(responseObject.Value <int>("count"));
        }