/// <summary> /// Gets a list of up to 250 of the shop's products. /// </summary> /// <returns></returns> public virtual async Task <IEnumerable <ShopifyProduct> > ListAsync(ShopifyProductFilter options = null) { IRestRequest req = RequestEngine.CreateRequest("products.json", Method.GET, "products"); //Add optional parameters to request if (options != null) { req.Parameters.AddRange(options.ToParameters(ParameterType.GetOrPost)); } return(await RequestEngine.ExecuteRequestAsync <List <ShopifyProduct> >(_RestClient, req)); }
/// <summary> /// Gets a count of all of the shop's products. /// </summary> /// <returns>The count of all products for the shop.</returns> public virtual async Task <int> CountAsync(ShopifyProductFilter filter = null) { IRestRequest req = RequestEngine.CreateRequest("products/count.json", Method.GET); //Add optional parameters to request if (filter != null) { req.Parameters.AddRange(filter.ToParameters(ParameterType.GetOrPost)); } JToken responseObject = await RequestEngine.ExecuteRequestAsync(_RestClient, req); //Response looks like { "count" : 123 }. Does not warrant its own class. return(responseObject.Value <int>("count")); }