コード例 #1
0
        public async Task <List <SnNavigation> > GetAllAsync()
        {
            result_List = _cacheutil.CacheString("ReGetAllAsync", result_List);
            if (result_List == null)
            {
                result_List = await CreateService <SnNavigation>().GetAllAsync();

                _cacheutil.CacheString("ReGetAllAsync", result_List);
            }
            return(result_List);
        }
コード例 #2
0
        /// <summary>
        /// 条件分页查询 - 支持排序
        /// </summary>
        /// <param name="type"></param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页记录条数</param>
        /// <param name="isDesc">是否倒序</param>
        public async Task <List <SnNavigation> > GetFyAllAsync(string type, int pageIndex, int pageSize, bool isDesc)
        {
            result_List = _cacheutil.CacheString("GetFyAllAsync" + type + pageIndex + pageSize + isDesc, result_List);
            if (result_List == null)
            {
                await GetFyAll(type, pageIndex, pageSize, isDesc);

                _cacheutil.CacheString("GetFyAllAsync" + type + pageIndex + pageSize + isDesc, result_List);
            }
            return(result_List);
        }
コード例 #3
0
        public async Task <List <SnOne> > GetAllAsync()
        {
            result_List = _cacheutil.CacheString("SnOne_GetAllAsync", result_List);
            if (result_List == null)
            {
                result_List = await _service.SnOne.ToListAsync();

                _cacheutil.CacheString("SnOne_GetAllAsync", result_List);
            }
            return(result_List);
        }
コード例 #4
0
        public async Task <SnLabels> GetByIdAsync(int id)
        {
            SnLabels labels = null;

            labels = _cacheUtil.CacheString("GetByIdAsync" + id, labels);
            if (labels == null)
            {
                labels = await _service.SnLabels.FindAsync(id);

                _cacheUtil.CacheString("GetByIdAsync" + id, labels);
            }
            return(labels);
        }
コード例 #5
0
        public async Task <SnSort> GetByIdAsync(int id)
        {
            SnSort result = default;

            result = _cacheutil.CacheString("SnSort_GetByIdAsync" + id, result);
            if (result != null)
            {
                return(result);
            }
            result = await _service.SnSort.FindAsync(id);

            _cacheutil.CacheString("SnSort_GetByIdAsync" + id, result);
            return(result);
        }
コード例 #6
0
        public async Task <List <SnArticle> > GetAllAsync()
        {
            result_List = _cacheutil.CacheString("GetAllSnArticleAsync", result_List);
            if (result_List == null)
            {
                result_List = await CreateService <SnArticle>().GetAllAsync();

                _cacheutil.CacheString("GetAllSnArticleAsync", result_List);
            }
            return(result_List);
        }
コード例 #7
0
        public async Task <SnArticle> AsyGetTestName(int id)
        {
            SnArticle result = null;

            result = _cacheutil.CacheString("AsyGetTestName" + id, result);
            if (result == null)
            {
                result = await _service.SnArticle.FindAsync(id);

                _cacheutil.CacheString("AsyGetTestName" + id, result);
            }
            return(result);
        }