Pagination Customization #138
Replies: 2 comments 4 replies
-
I like the idea to simplify to derive from @Biarity, @hasanmanzak I think we should do this for version 2.5 as suggested --> Moved this request to #139 I'd like to use this discussion about if we plan to make Sieve compatible with |
Beta Was this translation helpful? Give feedback.
-
My take on this is that top/skip pagination is a completely different operation to page/size. It is also an operation that other develoeprs will certainly find useful to have, so I think it is a good idea to implement it as a core part of Sieve (see my comment #144). In doing that though, do we allow both skip/top and page/size? Should they both be a part of the same |
Beta Was this translation helpful? Give feedback.
-
Currently, the only type of pagination available uses
page
andpageSize
. There are other ways pages may want to be defined that are not available because of this implementation detail. For instance, it's impossible to get the same results if I wanted to paginate usingtop
andskip
(the Microsoft API Guidelines for client-side pagination). And it's impossible to convert fromtop
andskip
topage
andpageSize
because the result sets are different (due to integer division).It's possible to make my own
SieveProcessor
to make this work, but there are a couple of issues with this.ISieveModel
interface definespage
andpageSize
which may be unused if using a different sort method.I think a quick fix to make this easier would be to make the
ApplyPagination
,ApplyFiltering
,ApplySorting
methods protected and virtual. This would let users inherit fromSieveProcessor
and only have to override the methods they care about changing. This fixes issue 1 and would not be a breaking change.To fix issue 2, however, would probably be a breaking change, because it would require a change to
ISieveModel
, although would be a good path forward for the next major version. Changing the interface to use Skip and Take would allow more flexibility for both cases (you can convert skip/take => page/pageSize, but not vice versa), but I think implementing a pagination interface would be more ideal, because it could allow other types of paging as well, such as server driven pagination.Beta Was this translation helpful? Give feedback.
All reactions