diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs index 57589add8..a677807dc 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs @@ -265,6 +265,13 @@ namespace OrmTest //}).ExecuteCommand(); var d1111111111111 = db.Queryable() .Mapper(it => ManyToMany.Config(it.UserId, it.RoleId)).InSingle(data.UserId); + RefAsync x11 = 0; + RefAsync y1 = 0; + db.Queryable().ToPageListAsync(1, 2, x11, y1).GetAwaiter().GetResult(); + if (x11.Value > 0 && y1.Value == 0) + { + throw new Exception("unit test error"); + } } diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 0cc961e34..d3aa2efe7 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -2122,10 +2122,10 @@ namespace SqlSugar this.Context.MappingTables = oldMapping; return await this.Clone().ToPageListAsync(pageIndex, pageSize); } - public Task> ToPageListAsync(int pageNumber, int pageSize, RefAsync totalNumber, RefAsync totalPage) + public async Task> ToPageListAsync(int pageNumber, int pageSize, RefAsync totalNumber, RefAsync totalPage) { - var result = ToPageListAsync(pageNumber, pageSize, totalNumber); - totalPage.Value = (totalNumber + pageSize - 1) / pageSize; + var result =await ToPageListAsync(pageNumber, pageSize, totalNumber); + totalPage.Value = (totalNumber.Value + pageSize - 1) / pageSize; return result; } public async Task ToJsonAsync()