Enable pagination result with QueryResult<T>#257
Enable pagination result with QueryResult<T>#257marinasundstrom wants to merge 1 commit intowp-net:masterfrom
Conversation
|
Hey @marinasundstrom, so sorry for not looking at this any sooner! Are you still interested in getting this merged? |
|
Hi @ThomasPe I briefly worked on the post count feature and I have some draft code here https://github.com/navjot50/WordPressPCL/tree/feature-posts-count. Basically, here I didn't introduce a custom result but rather introduced a new interface However, since we can introduce breaking changes in release2.0 we can go also go with a more custom result depending on what the library users want the most. |
This adds the ability to get the current Total and TotalPage in the result of a query, by adding the
QueryResult<T>class.I chose to go the easy way, similar to other places in the code, parse the headers of the last request, and put them and the resulting items into
QueryResult<T>.The QueryResult is a custom collection class that substitutes the use of
IEnumerable<T>as return type for IQueryOperation<TClass, QClass>.Query(...). It implementsIEnumerable<T>so enumeration will still be possible.XML documentation TBA
I will remove the Test project