public IQueryable <ProductCategory> GetSortedFilteredList(ProductCategoryListInput input, out int itemCount) { return(_productCateRepo.GetAll().FilterSortAndGetPage( config: input.AsFilterSortPageConfig(), args: input, itemCount: out itemCount)); }
public IActionResult GetList([FromQuery] ProductCategoryListInput input) { return(Ok(_productCateService .GetSortedFilteredList(input, out var itemCount) .Select(ProductCategoryListViewModel.GetFromProductCategory) .ToPagedResults(resultCount: itemCount))); }
public static IFilterSortPageConfig <ProductCategory, ProductCategoryListInput, int> AsFilterSortPageConfig(this ProductCategoryListInput input) => new FilterSortPageConfigBuilder <ProductCategory, ProductCategoryListInput, int>( primaryKeySelector: n => n.Id, pageSize: input.pageSize, pageNumber: input.pageNumber) .WithFiltering(FILTERS) .WithSorting( sortCriteria: input.sortCriteria ?? DEFAULT_SORT_CRITERIA, orderByStringKeySelectors: ORDER_BY_STRING, orderByIntKeySelectors: ORDER_BY_INT ) .Build();