mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-17 01:46:18 +08:00
-
This commit is contained in:
parent
5cfb1efd8e
commit
35fb5d9633
@ -452,12 +452,19 @@ namespace SqlSugar
|
||||
{
|
||||
InitMapping();
|
||||
QueryBuilder.IsCount = true;
|
||||
|
||||
int reval = GetCount();
|
||||
|
||||
int result = 0;
|
||||
if (IsCache)
|
||||
{
|
||||
var cacheService = this.Context.CurrentConnectionConfig.ConfigureExternalServices.DataInfoCacheService;
|
||||
result = CacheSchemeMain.GetOrCreate<int>(cacheService, this.QueryBuilder, () => { return GetCount(); }, CacheTime, this.Context);
|
||||
}
|
||||
else
|
||||
{
|
||||
result= GetCount();
|
||||
}
|
||||
RestoreMapping();
|
||||
QueryBuilder.IsCount = false;
|
||||
return reval;
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual int Count(Expression<Func<T, bool>> expression)
|
||||
|
Loading…
Reference in New Issue
Block a user