コード例 #1
0
 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);
     }));
 }
コード例 #2
0
        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);
            }));
        }
コード例 #3
0
        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>&nbsp;{CacheSize +"%"}</span>
          </div>";
            }
        }