public async Task <IEnumerable <Order> > GetAllFilteredAsync(PaginationFilter paginationFilter, SortingFilter sortingFilter, GetAllOrdersFilter filter = null) { var query = dbContext.Set <Order>() .Include(x => x.OrderDetails) .ThenInclude(x => x.Product) .AsQueryable(); AddFiltersOnQuery(ref query, filter); SortingHelper.ApplySort(ref query, sortingFilter.OrderBy); return(await PaginationHelper <Order> .PagedList(query, paginationFilter.Page)); }