Pagination in Tickets.ListAsync
Closed this issue ยท 2 comments
martinavila69 commented
Hi,
I execute
Dim t As Responses.IPagination(Of Models.Ticket)
t = Await zdClient.Tickets.ListAsync
and it says that 400 tickets exist and I can access the first 100.
After that, I can not access the second, third, etc. pages (don't know how).
Could you please show me how?
Thanks in advance.
Martin
slang25 commented
@martinavila69 disclaimer: I haven't used this library.
It looks like there is an overload for ListAsync
that takes a PagerParameters
object, which can be used like this:
var retrievedTickets = (await _resource.ListAsync(new PagerParameters { Page = 1, PageSize = 5 })).ToArray();
so your code might look like this:
Dim retrievedTickets = (Await zdClient.Tickets.ListAsync(New PagerParameters With {.Page = 2, .PageSize = 100})).ToArray()
Let us know if this doesn't resolve your issue, and I'll let someone who knows what they are talking about answer ๐
martinavila69 commented
Thank you @slang25!
It worked perfectly! Now I see the example in the test files.