コード例 #1
0
 public IQueryable <ProductCategory> GetSortedFilteredList(ProductCategoryListInput input, out int itemCount)
 {
     return(_productCateRepo.GetAll().FilterSortAndGetPage(
                config: input.AsFilterSortPageConfig(),
                args: input,
                itemCount: out itemCount));
 }
コード例 #2
0
 public IActionResult GetList([FromQuery] ProductCategoryListInput input)
 {
     return(Ok(_productCateService
               .GetSortedFilteredList(input, out var itemCount)
               .Select(ProductCategoryListViewModel.GetFromProductCategory)
               .ToPagedResults(resultCount: itemCount)));
 }
コード例 #3
0
 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();