mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-30 04:45:54 +08:00
-
This commit is contained in:
parent
3aa384212e
commit
f6dd14c66b
@ -596,13 +596,10 @@ namespace SqlSugar
|
||||
}
|
||||
public virtual int Count()
|
||||
{
|
||||
MappingTableList expMapping = new MappingTableList();
|
||||
if (QueryBuilder.EntityName== "ExpandoObject" && this.Context.MappingTables.Any(it => it.EntityName == "ExpandoObject"))
|
||||
{
|
||||
if (OldMappingTableList == null)
|
||||
{
|
||||
OldMappingTableList = new MappingTableList();
|
||||
}
|
||||
OldMappingTableList.Add("ExpandoObject", this.Context.MappingTables.First(it => it.EntityName == "ExpandoObject").DbTableName);
|
||||
expMapping.Add("ExpandoObject", this.Context.MappingTables.First(it => it.EntityName == "ExpandoObject").DbTableName);
|
||||
}
|
||||
InitMapping();
|
||||
QueryBuilder.IsCount = true;
|
||||
@ -618,6 +615,14 @@ namespace SqlSugar
|
||||
}
|
||||
RestoreMapping();
|
||||
QueryBuilder.IsCount = false;
|
||||
if (expMapping.Count > 0)
|
||||
{
|
||||
if (this.QueryableMappingTableList == null)
|
||||
{
|
||||
this.QueryableMappingTableList = new MappingTableList();
|
||||
}
|
||||
this.QueryableMappingTableList.Add(expMapping.First());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user