SimpleClient.GetPageListAsync

This commit is contained in:
skx 2021-01-05 21:41:46 +08:00
parent cb5053e537
commit addfd14211

View File

@ -189,10 +189,10 @@ namespace SqlSugar
{
return Context.Queryable<T>().SingleAsync(whereExpression);
}
public virtual Task<List<T>> GetPageListAsync(Expression<Func<T, bool>> whereExpression, PageModel page)
public async virtual Task<List<T>> GetPageListAsync(Expression<Func<T, bool>> whereExpression, PageModel page)
{
RefAsync<int> count = 0;
var result = Context.Queryable<T>().Where(whereExpression).ToPageListAsync(page.PageIndex, page.PageSize, count);
var result = await Context.Queryable<T>().Where(whereExpression).ToPageListAsync(page.PageIndex, page.PageSize, count);
page.PageCount = count;
return result;
}