using EntrustSettle.Model;
using SqlSugar;
using System.Threading.Tasks;
namespace EntrustSettle.Common.Extensions;
///
/// 分页拓展类
///
public static class PagedQueryableExtensions
{
public static async Task> ToPageListAsyncExtension(this ISugarQueryable query, int pageIndex, int pageSize)
{
RefAsync totalCount = 0;
System.Collections.Generic.List data = await query.ToPageListAsync(pageIndex, pageSize, totalCount);
return new PageModel(pageIndex, totalCount, pageSize, data);
}
}