Exemplo n.º 1
0
        /// <summary>
        /// 获得此ID的类别详细信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static CategoryInfo Get(int id)
        {
            var item = ArticleCategoryManage.Get(id);

            LoadExtionsion(item);
            return(item);
        }
Exemplo n.º 2
0
        public static CategoryInfo Get(int id, bool useCache)
        {
            if (!useCache)
            {
                return(ArticleCategoryManage.Get(id));
            }
            //需要加缓存
            string KEY  = string.Format("GET_CATEGORY_INFO_{0}", id);
            var    info = (CategoryInfo)webCache[KEY];

            if (info == null)
            {
                info = ArticleCategoryManage.Get(id);
                webCache.Insert(KEY, info, null, DateTime.Now.AddMinutes(CACHETIMEOUT), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.High, null);
            }
            return(info);
        }