public static StartNodeCollection GetCachedStartNodesByUserId(int userId, ApplicationContext applicationContext, DatabaseContext databaseContext)
        {
            StartNodeCollection startNodes = applicationContext.ApplicationCache.RuntimeCache.GetCacheItem <StartNodeCollection>(Resources.CacheKeyPrefix + userId.ToString());

            if (startNodes == null)
            {
                startNodes = GetAndCacheStartNodes(userId, applicationContext, databaseContext);
            }

            return(startNodes);
        }
        private static StartNodeCollection CacheUserStartNodes(int userId, UserStartNodes userStartNodes, ApplicationContext applicationContext, DatabaseContext databaseContext)
        {
            StartNodeCollection startNodes = new StartNodeCollection();

            if (userStartNodes != null)
            {
                startNodes.Content = (!string.IsNullOrWhiteSpace(userStartNodes.Content)) ? Array.ConvertAll(userStartNodes.Content.Split(','), int.Parse) : null;
                startNodes.Media   = (!string.IsNullOrWhiteSpace(userStartNodes.Media)) ? Array.ConvertAll(userStartNodes.Media.Split(','), int.Parse) : null;
            }

            applicationContext.ApplicationCache.RuntimeCache.InsertCacheItem <StartNodeCollection>(Resources.CacheKeyPrefix + userId.ToString(), () => startNodes);

            return(startNodes);
        }