This commit is contained in:
sunkaixuan 2019-05-19 18:10:12 +08:00
parent a029e15696
commit fcf522cdc6
4 changed files with 23 additions and 3 deletions

View File

@ -141,6 +141,7 @@
<Compile Include="OldTest\UnitTest\Setting\MapTable.cs" />
<Compile Include="OldTest\UnitTest\Update.cs" />
<Compile Include="UnitTest\UAdo.cs" />
<Compile Include="UnitTest\UQueryableAsync.cs" />
<Compile Include="UnitTest\UThread3.cs" />
<Compile Include="UnitTest\UThread2.cs" />
<Compile Include="UnitTest\UValidate.cs" />

View File

@ -27,6 +27,7 @@ namespace OrmTest
{
Json();
Ado();
QueryableAsync();
Thread();
Thread2();
Thread3();

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
namespace OrmTest
{
public partial class NewUnitTest
{
public static void QueryableAsync()
{
RefAsync<int> total = 0;
Task t=Db.Queryable<Order>().ToPageListAsync(1, 2, total);
t.Wait();
}
}
}

View File

@ -998,7 +998,7 @@ namespace SqlSugar
}
public async Task<List<T>> ToPageListAsync(int pageIndex, int pageSize, RefAsync<int> totalNumber)
{
totalNumber = await this.Clone().CountAsync();
totalNumber.Value = await this.Clone().CountAsync();
return await this.Clone().ToPageListAsync(pageIndex, pageSize);
}
public async Task<string> ToJsonAsync()
@ -1023,7 +1023,7 @@ namespace SqlSugar
}
public async Task<string> ToJsonPageAsync(int pageIndex, int pageSize, RefAsync<int> totalNumber)
{
totalNumber = await this.Clone().CountAsync();
totalNumber.Value = await this.Clone().CountAsync();
return await this.Clone().ToJsonPageAsync(pageIndex, pageSize);
}
public async Task<DataTable> ToDataTableAsync()
@ -1050,7 +1050,7 @@ namespace SqlSugar
}
public async Task<DataTable> ToDataTablePageAsync(int pageIndex, int pageSize, RefAsync<int> totalNumber)
{
totalNumber = await this.Clone().CountAsync();
totalNumber.Value = await this.Clone().CountAsync();
return await this.Clone().ToDataTablePageAsync(pageIndex, pageSize);
}