Exemplo n.º 1
0
 public IQueryable <Blog> GetSortedFilteredList(BlogListInput input, out int itemCount)
 {
     return(_blogService.GetAll().FilterSortAndGetPage(
                config: input.AsFilterSortPageConfig(),
                args: input,
                itemCount: out itemCount));
 }
Exemplo n.º 2
0
 public IActionResult GetList([FromQuery] BlogListInput input)
 {
     return(Ok(_blogService
               .GetSortedFilteredList(input, out var itemCount)
               .Select(BlogListViewModel.GetFromBlog)
               .ToPagedResults(resultCount: itemCount)));
 }
Exemplo n.º 3
0
 public static IFilterSortPageConfig <Blog, BlogListInput, int> AsFilterSortPageConfig(this BlogListInput input) =>
 new FilterSortPageConfigBuilder <Blog, BlogListInput, 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();