using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace gpt_api.Core.Extensions
{
///
/// 分页扩展
///
public static class PagedQueryableExtension
{
///
/// 获取分页列表
///
///
///
///
public static async Task> ToPagedListAsync(this ISugarQueryable query, PagedInput page)
{
RefAsync count = 0;
List result = await query.ToPageListAsync(page.PageIndex, page.PageSize, count);
return new PagedList
{
TotalCount = count.Value,
List = result
};
}
}
}