From 5a2e13c781a3e0ab152d279e97a0fd18e018b3f2 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 27 Mar 2022 21:44:09 +0800 Subject: [PATCH] Performance optimization --- .../SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 4d08a8053..afbe48904 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -1285,7 +1285,10 @@ namespace SqlSugar { if (cancellationTokenSource?.IsCancellationRequested == true) return; var queryable = this.Clone(); - var page = queryable.ToPageList(i, singleMaxReads, ref totalNumber, ref totalPage); + var page = + totalPage==1? + queryable.ToPageList(i, singleMaxReads, ref totalNumber, ref totalPage): + queryable.ToPageList(i, singleMaxReads); foreach (var item in page) { if (cancellationTokenSource?.IsCancellationRequested == true) return;