SenseNet.ContentRepository.Storage.DataBackingStore.CreateNodeHeadPathCacheKey C# (CSharp) Method

CreateNodeHeadPathCacheKey() public static method

public static CreateNodeHeadPathCacheKey ( string path ) : string
path string
return string
        public static string CreateNodeHeadPathCacheKey(string path)
        {
            return string.Concat(NODE_HEAD_PREFIX, path.ToLowerInvariant());
        }
        public static string CreateNodeHeadIdCacheKey(int nodeId)

Usage Example

Example #1
0
        internal static bool NodeExists(string path)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            if (!CanExistInDatabase(path))
            {
                return(false);
            }

            // Look at the cache first
            var pathKey = DataBackingStore.CreateNodeHeadPathCacheKey(path);

            if (DistributedApplication.Cache.Get(pathKey) as NodeHead != null)
            {
                return(true);
            }

            // If it wasn't in the cache, check the database
            return(DataProvider.NodeExists(path));
        }