From 74feebbffb7af6a78d42d94d2bea69de5a8b9b6f Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 14 Jun 2016 16:38:04 +1000 Subject: [PATCH] add some examples to pagination docs (#1378) --- docs/extensibility.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/extensibility.md b/docs/extensibility.md index abab1675..4d662e91 100644 --- a/docs/extensibility.md +++ b/docs/extensibility.md @@ -21,5 +21,29 @@ var repositories = await client.Repository.GetAllForCurrent(options); - `PageSize` - change the number of results to return per page - `StartPage` - start results from a given page -These parameters can be used in any sort of group. If you don't specify a -`PageSize` the default page size is 30. +If `PageSize` is not set the default page size is 30. + +Examples: + +```csharp +// fetch all items, 100 at a time +var batchPagination = new ApiOptions +{ + PageSize = 100 +}; + +// return first 100 items +var firstOneHundred = new ApiOptions +{ + PageSize = 100, + PageCount = 1 +}; + +// return 100 items after first page +var skipFirstHundred = new ApiOptions +{ + PageSize = 100, + StartPage = 2, // 1-indexed value + PageCount = 1 +}; +```