示例#1
0
        public async Task <int> CountAsync()
        {
            result_Int = _cacheutil.CacheNumber("SnNavigationType_CountAsync", result_Int);
            if (result_Int == 0)
            {
                result_Int = await _service.SnNavigationType.CountAsync();

                _cacheutil.CacheNumber("SnNavigationType_CountAsync", result_Int);
            }
            return(result_Int);
        }
示例#2
0
        public async Task <int> GetCountAsync()
        {
            result_Int = _cacheUtil.CacheNumber("GetCountAsync", result_Int);
            if (result_Int == 0)
            {
                result_Int = await _service.SnLabels.CountAsync();

                _cacheUtil.CacheNumber("GetCountAsync", result_Int);
            }
            return(result_Int);
        }
示例#3
0
        public async Task <int> GetCountAsync()
        {
            result_Int = _cacheUtil.CacheNumber("ReGetCountAsync", result_Int);
            if (result_Int == 0)
            {
                result_Int = await CreateService <SnLabels>().CountAsync();

                _cacheUtil.CacheNumber("ReGetCountAsync", result_Int);
            }
            return(result_Int);
        }
示例#4
0
        public async Task <int> CountAsync()
        {
            result_Int = _cacheutil.CacheNumber("CountAsyncSnLeave", result_Int);
            if (result_Int == 0)
            {
                result_Int = await _service.SnLeave.CountAsync();

                _cacheutil.CacheNumber("CountAsyncSnLeave", result_Int);
            }
            return(result_Int);
        }
        public async Task <int> CountAsync()
        {
            result_Int = _cacheutil.CacheNumber("SnPicture_CountAsync", result_Int);
            if (result_Int != 0)
            {
                return(result_Int);
            }
            result_Int = await _service.SnPicture.CountAsync();

            _cacheutil.CacheNumber("SnPicture_CountAsync", result_Int);
            return(result_Int);
        }
        public async Task <int> CountAsync()
        {
            result_Int = _cacheutil.CacheNumber("CountAsync", result_Int);
            if (result_Int == 0)
            {
                result_Int = await CreateService <SnArticle>().CountAsync();

                _cacheutil.CacheNumber("CountAsync", result_Int);
            }
            return(result_Int);
        }
 /// <summary>
 /// 查询标签总数
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public int ConutLabel(int type)
 {
     //读取缓存值
     result_Int = _cacheutil.CacheNumber("ConutLabel" + type, result_Int);
     if (result_Int == 0)
     {
         result_Int = _service.SnArticle.Count(c => c.label_id == type);
         _cacheutil.CacheNumber("ConutLabel" + type, result_Int);//设置缓存值
     }
     return(result_Int);
 }