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
Copy file name to clipboardExpand all lines: README.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,8 @@ Learn about why the standard offset based pagination (`Take().Skip()`) is bad in
14
14
15
15
Check the [benchmarks](#benchmarks) section below for a quick look at the different performance characteristics between offset and keyset.
16
16
17
-
**Note:** If you're using ASP.NET Core, you can use [MR.AspNetCore.Pagination](https://github.com/mrahhal/MR.AspNetCore.Pagination) which wraps this package and offers an easier to consume keyset pagination behavior with additional features for ASP.NET Core. This is a lower level library that implements keyset pagination for EF Core.
17
+
> **Note**
18
+
> If you're using ASP.NET Core, you can use [MR.AspNetCore.Pagination](https://github.com/mrahhal/MR.AspNetCore.Pagination) which wraps this package and offers an easier to consume keyset pagination behavior with additional features for ASP.NET Core. This is a lower level library that implements keyset pagination for EF Core.
18
19
19
20
## Usage
20
21
@@ -43,7 +44,8 @@ Here's a small visual representation:
43
44
44
45
The columns and their configured order are used to order the data, and then the direction decides if we're getting the data before or after the reference row.
45
46
46
-
**Note:** You'll want to reverse the result whenever you use `KeysetPaginationDirection.Backward` to get the proper order of the data, since walking `Backward` gives results in the opposite order to the configured columns order. There's a helper method on `KeysetContext` for this, shown in a snippet later.
47
+
> **Warning**
48
+
> You'll want to reverse the result whenever you use `KeysetPaginationDirection.Backward` to get the proper order of the data, since walking `Backward` gives results in the opposite order to the configured columns order. There's a helper method on `KeysetContext` for this, shown in a snippet later.
47
49
48
50
`KeysetPaginate` returns a context object which you can use to get secondary info and get the data result.
49
51
@@ -73,7 +75,8 @@ KeysetPaginate(
73
75
)
74
76
```
75
77
76
-
**Note:** Make sure to read the "Deterministic keysets" and "Indexing" sections for important notes about configuring keysets.
78
+
> **Important**
79
+
> Make sure to read the "Deterministic keysets" and "Indexing" sections for important notes about configuring keysets.
77
80
78
81
## Common patterns
79
82
@@ -204,7 +207,8 @@ var hasNext = await keysetContext.HasNextAsync(users);
204
207
205
208
`HasPreviousAsync`/`HasNextAsync` are useful when you want to know when to render Previous/Next (Older/Newer) buttons.
206
209
207
-
**Note**: The reference/data these methods accept are loosely typed to allow flexibility when projecting your models (to DTOs for example). For more info check [this document](./docs/loose-typing.md).
210
+
> **Note**
211
+
> The reference/data these methods accept are loosely typed to allow flexibility when projecting your models (to DTOs for example). For more info check [this document](./docs/loose-typing.md).
208
212
209
213
Here's another example showing how to obtain the total count for the data to display somewhere:
210
214
@@ -312,7 +316,8 @@ KeysetPaginate(
312
316
313
317
In this case you'll want to create a composite index on `Score` + `Id`, but make sure they're compatible with the order above. i.e You should make the index descending on `Score` and ascending on `Id` (or the opposite) for it to be effective.
314
318
315
-
**Note**: Refer to [this document](https://docs.microsoft.com/en-us/ef/core/modeling/indexes) on how to create indexes with EF Core. Note that support for specifying sort order in a composite index was introduced in EF Core 7.0.
319
+
> **Note**
320
+
> Refer to [this document](https://docs.microsoft.com/en-us/ef/core/modeling/indexes) on how to create indexes with EF Core. Note that support for specifying sort order in a composite index was introduced in EF Core 7.0.
0 commit comments