mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Update CountAsync
This commit is contained in:
@@ -2114,6 +2114,16 @@ namespace SqlSugar
|
|||||||
|
|
||||||
public async Task<int> CountAsync()
|
public async Task<int> CountAsync()
|
||||||
{
|
{
|
||||||
|
if (this.QueryBuilder.Skip == null &&
|
||||||
|
this.QueryBuilder.Take == null &&
|
||||||
|
this.QueryBuilder.OrderByValue == null &&
|
||||||
|
this.QueryBuilder.PartitionByValue == null &&
|
||||||
|
this.QueryBuilder.SelectValue == null &&
|
||||||
|
this.QueryBuilder.Includes == null)
|
||||||
|
{
|
||||||
|
var list = await this.Clone().Select<int>(" COUNT(1) ").ToListAsync();
|
||||||
|
return list.First();
|
||||||
|
}
|
||||||
MappingTableList expMapping;
|
MappingTableList expMapping;
|
||||||
int result;
|
int result;
|
||||||
_CountBegin(out expMapping, out result);
|
_CountBegin(out expMapping, out result);
|
||||||
|
Reference in New Issue
Block a user