Exemple #1
0
        public static int GetUserTaggedStoryCount(string tagIdentifier, int userID, int hostID)
        {
            string cacheKey = String.Format("Kick_UserTaggedStoryCount_{0}_{1}_{2}", tagIdentifier, userID, hostID);
            CacheManager <string, int?> countCache = GetCountCache();

            int?count = countCache[cacheKey];

            if (count == null)
            {
                count = Story.GetUserTaggedStoryCount(TagCache.GetTagID(tagIdentifier), userID, hostID);
                countCache.Insert(cacheKey, count, CacheHelper.CACHE_DURATION_IN_SECONDS);
            }

            return(count.Value);
        }
Exemple #2
0
        public static StoryCollection GetUserTaggedStories(string tagIdentifier, int userID, int hostID, int pageNumber, int pageSize)
        {
            string cacheKey = String.Format("Kick_UserTaggedStoryTable_{0}_{1}_{2}_{3}", tagIdentifier, userID, hostID, pageNumber);

            CacheManager <string, StoryCollection> storyCache = GetStoryCollectionCache();

            StoryCollection stories = storyCache[cacheKey];

            if (stories == null)
            {
                stories = Story.GetUserTaggedStories(TagCache.GetTagID(tagIdentifier), userID, hostID, pageNumber, pageSize);
                storyCache.Insert(cacheKey, stories, CacheHelper.CACHE_DURATION_IN_SECONDS);
            }

            return(stories);
        }