Optimize the code

This commit is contained in:
sunkaixuan
2025-08-03 15:07:56 +08:00
parent 1b37f5429c
commit 2abafebfbe

View File

@@ -460,18 +460,18 @@ AND sql LIKE '%"+tableName+"%'");
this.Context.Ado.ExecuteCommand($"VACUUM INTO '{fullFileName}'"); this.Context.Ado.ExecuteCommand($"VACUUM INTO '{fullFileName}'");
return true; return true;
} }
private List<T> GetListOrCache<T>(string cacheKey, string sql) //private List<T> GetListOrCache<T>(string cacheKey, string sql)
{ //{
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, // return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
() => // () =>
{ // {
var isEnableLogEvent = this.Context.Ado.IsEnableLogEvent; // var isEnableLogEvent = this.Context.Ado.IsEnableLogEvent;
this.Context.Ado.IsEnableLogEvent = false; // this.Context.Ado.IsEnableLogEvent = false;
var reval = this.Context.Ado.SqlQuery<T>(sql); // var reval = this.Context.Ado.SqlQuery<T>(sql);
this.Context.Ado.IsEnableLogEvent = isEnableLogEvent; // this.Context.Ado.IsEnableLogEvent = isEnableLogEvent;
return reval; // return reval;
}); // });
} //}
#endregion #endregion
} }
} }