Пример #1
0
        /// <summary>
        /// 根据类别得到最新帖子
        /// </summary>
        /// <param name="typeDeID"></param>
        /// <returns></returns>
        public static List<BBSMain> BBSMainNewListByType(int typeDeID)
        {
            string key = "BBSMainNewListByType" + typeDeID;
            List<BBSMain> data = (List<BBSMain>)HttpRuntime.Cache[key];
            if (data == null)
            {
                bizBBSMain b = new bizBBSMain();
                data = b.ListByNew(1, typeDeID, 10);
                HttpRuntime.Cache.Add(key, data, null, DateTime.Now.AddMinutes(30), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }

            return data;
        }