Repair distinct count bug

This commit is contained in:
sunkaixuan 2022-07-10 14:14:38 +08:00
parent ddfda2d463
commit e3e4026e91

View File

@ -1143,7 +1143,8 @@ namespace SqlSugar
this.QueryBuilder.OrderByValue == null &&
this.QueryBuilder.PartitionByValue == null&&
this.QueryBuilder.SelectValue==null&&
this.QueryBuilder.Includes == null)
this.QueryBuilder.Includes == null&&
this.QueryBuilder.IsDistinct==false)
{
return this.Clone().Select<int>(" COUNT(1) ").ToList().First();
@ -2154,7 +2155,8 @@ namespace SqlSugar
this.QueryBuilder.OrderByValue == null &&
this.QueryBuilder.PartitionByValue == null &&
this.QueryBuilder.SelectValue == null &&
this.QueryBuilder.Includes == null)
this.QueryBuilder.Includes == null&&
this.QueryBuilder.IsDistinct==false)
{
var list = await this.Clone().Select<int>(" COUNT(1) ").ToListAsync();
return list.First();