SqlSugar源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

6 years ago
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()
6 years ago
{
q1();
q2();
q3();
}
private static void q1()
{
RefAsync<int> total = 0;
var count = Db.Queryable<Order>().Count();
Task t = Db.Queryable<Order>().ToPageListAsync(1, 2, total);
t.Wait();
UValidate.Check(count, total.Value, "QueryableAsync");
}
private static void q2()
{
RefAsync<int> total = 0;
var count = Db.Queryable<Order>().Count();
Task t = Db.Queryable<Order>().ToDataTablePageAsync(1, 2, total);
t.Wait();
UValidate.Check(count, total.Value, "QueryableAsync");
}
private static void q3()
6 years ago
{
RefAsync<int> total = 0;
6 years ago
var count = Db.Queryable<Order>().Count();
Task t = Db.Queryable<Order>().ToJsonPageAsync(1, 2, total);
6 years ago
t.Wait();
6 years ago
UValidate.Check(count, total.Value, "QueryableAsync");
6 years ago
}
}
}