public int QueryCount <TEntity>(Expression <Func <TEntity, bool> > filter) where TEntity : class { SqlGenerator.QueryCount(this, filter); return(DbCacheManager.GetCount(this, filter, () => { return int.TryParse(Convert.ToString(DbHelper.ExecuteScalar(SqlStatement)), out int result) ? result : default(int); })); }
public int QueryCount <TEntity>(Expression <Func <TEntity, bool> > filter) where TEntity : class { SqlStatement = filter.ToString(); return(DbCacheManager.GetCount(this, filter, () => { switch (DataBaseType) { case DataBaseType.MongoDB: return Convert.ToInt32(GetCollectionEntity <TEntity>().Count(filter)); default: break; } return default(int); })); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (!IsPostBack) { BreadCrumbSettings(AppManager.Settings.LeftMenu.Utility, "系统缓存", AppManager.Settings.Permission.SettingsUtility); CacheCount = CacheUtils.GetCacheCount() + DbCacheManager.GetCount(); CacheSize = 100 - CacheUtils.GetCacheEnabledPercent(); CachePercentStr = $@"<div style=""width:230px;"" class=""progress progress-success progress-striped""> <div class=""bar"" style=""width: {100 - CacheUtils.GetCacheEnabledPercent()}%""></div><span> {CacheSize +"%"}</span> </div>"; } }