Skip to content

Commit 433ca4a

Browse files
committed
pagination fix
1 parent a044b54 commit 433ca4a

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

src/GridifyExtensions/GridifyExtensions.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<PackageReadmeFile>Readme.md</PackageReadmeFile>
99
<Authors>Pandatech</Authors>
1010
<Copyright>MIT</Copyright>
11-
<Version>1.0.6</Version>
11+
<Version>1.0.7</Version>
1212
<PackageId>Pandatech.GridifyExtensions</PackageId>
1313
<Title>Pandatech.Gridify.Extensions</Title>
1414
<PackageTags>Pandatech, library, Gridify, Pagination, Filters</PackageTags>
1515
<Description>Pandatech.Gridify.Extensions simplifies and extends the functionality of the Gridify NuGet package. It provides additional extension methods and functionality to streamline data filtering and pagination, making it more intuitive and powerful to use in .NET applications. Our enhancements ensure more flexibility, reduce boilerplate code, and improve overall developer productivity when working with Gridify.</Description>
1616
<RepositoryUrl>https://github.com/PandaTechAM/be-lib-gridify-extensions</RepositoryUrl>
17-
<PackageReleaseNotes>Bug fix column distinct value</PackageReleaseNotes>
17+
<PackageReleaseNotes>Pagination fix</PackageReleaseNotes>
1818
</PropertyGroup>
1919

2020
<ItemGroup>

src/GridifyExtensions/Models/GridifyQueryModel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace GridifyExtensions.Models
55
{
66
public class GridifyQueryModel : GridifyQuery
77
{
8-
public new int Page
8+
public new required int Page
99
{
1010
get => base.Page;
1111
set
@@ -19,7 +19,7 @@ public class GridifyQueryModel : GridifyQuery
1919
}
2020
}
2121

22-
public new int PageSize
22+
public new required int PageSize
2323
{
2424
get => base.PageSize;
2525
set
@@ -43,10 +43,11 @@ public class GridifyQueryModel : GridifyQuery
4343
get => base.OrderBy;
4444
set => base.OrderBy = value;
4545
}
46+
4647
public new string? Filter
4748
{
4849
get => base.Filter;
4950
set => base.Filter = value;
5051
}
5152
}
52-
}
53+
}
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
using GridifyExtensions.Extensions;
22
using System.Reflection;
3+
using GridifyExtensions.Models;
4+
using Microsoft.AspNetCore.Mvc;
35

46
var builder = WebApplication.CreateBuilder(args);
57

68

79
builder.Services.AddEndpointsApiExplorer();
810
builder.Services.AddSwaggerGen();
11+
builder.Services.AddControllers();
912

1013
builder.AddGridify(Assembly.GetExecutingAssembly());
1114

1215
var app = builder.Build();
1316

1417
app.UseSwagger();
1518
app.UseSwaggerUI();
16-
17-
18-
app.Run();
19+
app.MapControllers();
20+
21+
app.Run();
22+
23+
[ApiController]
24+
[Route("api/")]
25+
public class SomeController : ControllerBase
26+
{
27+
[HttpGet("test")]
28+
public IActionResult Get([FromQuery] GridifyQueryModel request)
29+
{
30+
return Ok(request);
31+
}
32+
}

0 commit comments

Comments
 (0)