mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Add ToPageList +4
This commit is contained in:
parent
1295703a63
commit
60106fa239
@ -1868,6 +1868,19 @@ namespace SqlSugar
|
||||
pageIndex = _PageList(pageIndex, pageSize);
|
||||
return ToList();
|
||||
}
|
||||
public virtual List<TResult> ToPageList<TResult>(int pageIndex, int pageSize, ref int totalNumber,Expression<Func<T, TResult>> expression)
|
||||
{
|
||||
if (this.QueryBuilder.Includes.Count > 0)
|
||||
{
|
||||
var list = this.ToPageList(pageIndex,pageSize,ref totalNumber).Select(expression.Compile()).ToList();
|
||||
return list;
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = this.Select(expression).ToPageList(pageIndex, pageSize, ref totalNumber).ToList();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
public virtual List<T> ToPageList(int pageIndex, int pageSize, ref int totalNumber)
|
||||
{
|
||||
var oldMapping = this.Context.MappingTables;
|
||||
@ -2117,6 +2130,20 @@ namespace SqlSugar
|
||||
pageIndex = _PageList(pageIndex, pageSize);
|
||||
return ToListAsync();
|
||||
}
|
||||
public async virtual Task<List<TResult>> ToPageList<TResult>(int pageIndex, int pageSize, RefAsync<int> totalNumber, Expression<Func<T, TResult>> expression)
|
||||
{
|
||||
if (this.QueryBuilder.Includes.Count > 0)
|
||||
{
|
||||
var pList = await this.ToPageListAsync(pageIndex, pageSize, totalNumber);
|
||||
var list = pList.Select(expression.Compile()).ToList();
|
||||
return list;
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = await this.Select(expression).ToPageListAsync(pageIndex, pageSize, totalNumber) ;
|
||||
return list;
|
||||
}
|
||||
}
|
||||
public async Task<List<T>> ToPageListAsync(int pageIndex, int pageSize, RefAsync<int> totalNumber)
|
||||
{
|
||||
var oldMapping = this.Context.MappingTables;
|
||||
|
Loading…
Reference in New Issue
Block a user