Skip to content

Commit bc6dd68

Browse files
author
Ruben Bisharyan
committed
Add SetMaxPageSize method
1 parent f1ba167 commit bc6dd68

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ var pagedResponse = await dbContext.Books
108108
var gridifyQueryModel = new GridifyQueryModel(false) { PageSize = 10, Page = 1 };
109109
```
110110

111+
As an alternative solution you can use 'SetMaxPageSize()' method to set PageSize into 'int.MaxValue' instead of using constructor parameter.
112+
```csharp
113+
gridifyQueryModel.SetMaxPageSize();
114+
```
115+
111116
Use ColumnDistinctValuesAsync to get distinct values of a specific column:
112117
```csharp
113118
public static async Task<CursoredResponse<object>> ColumnDistinctValuesAsync<TEntity>(

src/GridifyExtensions/GridifyExtensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageReadmeFile>Readme.md</PackageReadmeFile>
99
<Authors>Pandatech</Authors>
1010
<Copyright>MIT</Copyright>
11-
<Version>1.4.1</Version>
11+
<Version>1.4.2</Version>
1212
<PackageId>Pandatech.GridifyExtensions</PackageId>
1313
<Title>Pandatech.Gridify.Extensions</Title>
1414
<PackageTags>Pandatech, library, Gridify, Pagination, Filters</PackageTags>

src/GridifyExtensions/Models/GridifyQueryModel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public GridifyQueryModel()
1111
{
1212
_validatePageSize = true;
1313
}
14-
14+
1515
public GridifyQueryModel(bool validatePageSize)
1616
{
1717
_validatePageSize = validatePageSize;
@@ -61,5 +61,11 @@ public GridifyQueryModel(bool validatePageSize)
6161
get => base.Filter;
6262
set => base.Filter = value;
6363
}
64+
65+
public void SetMaxPageSize()
66+
{
67+
_validatePageSize = false;
68+
PageSize = int.MaxValue;
69+
}
6470
}
6571
}

0 commit comments

Comments
 (0)