예제 #1
0
 public IActionResult GetList([FromQuery] ContentPageListInput input)
 {
     return(Ok(_contentPageService
               .GetSortedFilteredList(input, out var itemCount)
               .Select(ContentPageListViewModel.GetFromContentPage)
               .ToPagedResults(resultCount: itemCount)));
 }
예제 #2
0
 public IQueryable <ContentPage> GetSortedFilteredList(ContentPageListInput input, out int itemCount)
 {
     return(_contentPageRepo.GetAll().FilterSortAndGetPage(
                config: input.AsFilterSortPageConfig(),
                args: input,
                itemCount: out itemCount));
 }
 public static IFilterSortPageConfig <ContentPage, ContentPageListInput, int> AsFilterSortPageConfig(this ContentPageListInput input) =>
 new FilterSortPageConfigBuilder <ContentPage, ContentPageListInput, int>(
     primaryKeySelector: n => n.Id,
     pageSize: input.pageSize,
     pageNumber: input.pageNumber)
 .WithFiltering(FILTERS)
 .WithSorting(
     sortCriteria: input.sortCriteria ?? DEFAULT_SORT_CRITERIA,
     orderByStringKeySelectors: ORDER_BY_STRING
     )
 .Build();