---
title: Paginate Optimizely Graph results with the C# SDK
slug: cms-13/docs/pagination
docTags: 
createdAt: 2026-07-30T20:22:01.166Z
---

Use `.Skip()` and `.Limit()` to retrieve a specific page of results. Add `.IncludeTotal()` to get the total count needed to render page navigation.

## Skip and limit results

`.Skip()` sets how many items to skip. `.Limit()` sets how many to return:

```csharp
var result = await client
    .QueryContent<BlogPostPage>()
    .Skip(2)
    .Limit(3)
    .GetAsContentAsync();
```

This skips the first two items and returns the next three.

## Calculate page offsets

For page-number-based navigation, calculate the skip value from the current page number and page size:

```csharp
int pageSize = 10;
int currentPage = 1; // pages are 1-based

var result = await client
    .QueryContent<BlogPostPage>()
    .Skip((currentPage - 1) * pageSize)
    .Limit(pageSize)
    .IncludeTotal()
    .GetAsContentAsync();

int totalPages = (int)Math.Ceiling((double)result.Total!.Value / pageSize);
```

`result.Total` is `null` unless you call `.IncludeTotal()`. See [Include total](docId\:o5_jhMAfvFVRhR6IDGo-n) for details.

## Combine pagination with filters and ordering

Pagination methods compose freely with filters, ordering, and other query methods:

```csharp
var result = await client
    .QueryContent<BlogPostPage>()
    .Where(x => x.BlogCategory == "Tutorials")
    .OrderBy(x => x.StartPublish, OrderDirection.Descending)
    .Skip((currentPage - 1) * pageSize)
    .Limit(pageSize)
    .IncludeTotal()
    .GetAsContentAsync();
```
