You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In more advanced scenarios, you may want to store the continuation token returned from the service so that your code controls exactly when the next pages is fetched. The following example shows a basic scenario of how the token can be fetched and applied to paginated results:
718
+
719
+
```csharp
720
+
stringcontinuationToken=null;
721
+
boolmoreResultsAvailable=true;
722
+
while (moreResultsAvailable)
723
+
{
724
+
varpage=employeeTable
725
+
.Query<EmployeeEntity>()
726
+
.AsPages(continuationToken, pageSizeHint: 10)
727
+
.FirstOrDefault(); // pageSizeHint limits the number of results in a single page, so we only enumerate the first page
728
+
729
+
if (page==null)
730
+
break;
731
+
732
+
// Get the continuation token from the page
733
+
// Note: This value can be stored so that the next page query can be executed later
By using continuation tokens explicitly, you can control when your application retrieves the next segment of data. For example, if your client application enables users to page through the entities stored in a table, a user may decide not to page through all the entities retrieved by the query so your application would only use a continuation token to retrieve the next segment when the user had finished paging through all the entities in the current segment. This approach has several benefits:
0 commit comments