public async Task <IEnumerable <Mozu.Api.Contracts.ProductAdmin.Product> > GetProducts(int tenantId, int?siteId, int?masterCatalogId, int?startIndex, int?pageSize, string sortBy = null, string filter = null) { _apiContext = new ApiContext(tenantId, siteId, masterCatalogId); var productResource = new ProductResource(_apiContext); var products = await productResource.GetProductsAsync(startIndex, pageSize, sortBy, filter, null); return(products.Items); }
protected override async Task <bool> GetDataAsync() { var resource = new ProductResource(Context); _results = await resource.GetProductsAsync(startIndex : StartIndex, pageSize : PageSize, sortBy : SortBy, filter : Filter, responseFields : ResponseFields); TotalCount = _results.TotalCount; PageCount = _results.PageCount; PageSize = _results.PageSize; return(_results.Items != null && _results.Items.Count > 0); }
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); }