Skip to content

Commit

Permalink
修改PageRequest属性为不可空类型
Browse files Browse the repository at this point in the history
  • Loading branch information
witskeeper committed Nov 4, 2024
1 parent 8ac1406 commit 87c7758
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/NetCorePal.Extensions.Dto/PageRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class PageRequest
/// <summary>
/// 请求的页码,从1开始
/// </summary>
public int? Index { get; set; }
public int Index { get; set; }
/// <summary>
/// 请求的每页条数
/// </summary>
public int? Size { get; set; }
public int Size { get; set; }
}
4 changes: 2 additions & 2 deletions test/NetCorePal.Web/Application/Queries/OrderQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class OrderQuery(ApplicationDbContext applicationDbContext)
/// <param name="countTotal">是否需要总数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<PagedData<OrderQueryResult>> ListOrderByPage(string? name, int? index, int? size, bool countTotal, CancellationToken cancellationToken)
public async Task<PagedData<OrderQueryResult>> ListOrderByPage(string? name, int index, int size, bool countTotal, CancellationToken cancellationToken)
{
return await applicationDbContext.Orders
.Where(x => string.IsNullOrEmpty(name) || x.Name.Contains(name))
Expand All @@ -50,7 +50,7 @@ public async Task<PagedData<OrderQueryResult>> ListOrderByPage(string? name, int
/// <param name="size">每页数量</param>
/// <param name="countTotal">是否需要总数</param>
/// <returns></returns>
public PagedData<OrderQueryResult> ListOrderByPageSync(string? name, int? index, int? size, bool countTotal)
public PagedData<OrderQueryResult> ListOrderByPageSync(string? name, int index, int size, bool countTotal)
{
return applicationDbContext.Orders
.Where(x => string.IsNullOrEmpty(name) || x.Name.Contains(name))
Expand Down

0 comments on commit 87c7758

Please sign in to comment.