Skip to content

Commit 2e2354f

Browse files
committed
Support booleans
Closes #16
1 parent d940948 commit 2e2354f

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
## Unreleased
1111

12-
_Nothing yet_
12+
- Support booleans. [[#16](https://github.com/mrahhal/MR.EntityFrameworkCore.KeysetPagination/issues/16)]
1313

1414
## 1.0.1 - 2022-02-18
1515

src/MR.EntityFrameworkCore.KeysetPagination/KeysetPaginationExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public static class KeysetPaginationExtensions
1010
{
1111
{ typeof(string), GetCompareToMethod(typeof(string)) },
1212
{ typeof(Guid), GetCompareToMethod(typeof(Guid)) },
13+
{ typeof(bool), GetCompareToMethod(typeof(bool)) },
1314
};
1415
private static readonly ConstantExpression ConstantExpression0 = Expression.Constant(0);
1516

test/MR.EntityFrameworkCore.KeysetPagination.Tests/KeysetPaginationTest.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ public async Task KeysetPaginate_Raw()
2626
Assert.Equal(20, result.Count);
2727
}
2828

29+
[Fact]
30+
public async Task KeysetPaginate_bool()
31+
{
32+
var reference = DbContext.IntModels.First();
33+
34+
var result = await DbContext.IntModels.KeysetPaginateQuery(
35+
b => b.Ascending(x => x.IsDone),
36+
KeysetPaginationDirection.Forward,
37+
reference)
38+
.Take(20)
39+
.ToListAsync();
40+
}
41+
2942
[Fact]
3043
public async Task KeysetPaginate_AfterReference_int()
3144
{

test/MR.EntityFrameworkCore.KeysetPagination.Tests/TestModels/IntModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ public class IntModel
55
public int Id { get; set; }
66

77
public DateTime Created { get; set; }
8+
9+
public bool IsDone { get; set; }
810
}

0 commit comments

Comments
 (0)