public static UserActionCollection GetLatestUserActions(int hostID, int pageIndex, int pageSize, int?userID, Nullable <UserAction.ActionType> userActionType, int?storyID, int?chatID) { string cacheKey = GetCacheKey(hostID, pageIndex, pageSize, userID, userActionType, storyID, chatID); CacheManager <string, UserActionCollection> cache = GetUserActionCache(); UserActionCollection userActions = cache[cacheKey]; if (userActions == null) { userActions = UserAction.FetchCollection(hostID, pageIndex, pageSize, userID, userActionType, storyID, chatID); cache.Insert(cacheKey, userActions, 60, System.Web.Caching.CacheItemPriority.NotRemovable); } return(userActions); }