예제 #1
0
        private IQueryable <ContentPathCacheEntry> GetEntryByPathQuery(ContentPath path)
        {
            var pathString = path.ToString();
            var pathHash   = KnuthHash.CalculateHash(pathString);

            var pathCacheEntryQuery = ContentPathCacheEntries
                                      .Where(e => e.Hash == pathHash && e.Path == pathString);

            return(pathCacheEntryQuery);
        }
예제 #2
0
        void IContentPathCache.UpdatePath(ContentPath oldPath, ContentPath newPath)
        {
            if (oldPath == null)
            {
                throw new ArgumentNullException("oldPath");
            }

            if (newPath == null)
            {
                throw new ArgumentNullException("newPath");
            }

            var cacheEntry = GetEntryByPath(oldPath);

            UpdatePathRecursive(oldPath.ToString(), newPath.ToString(), cacheEntry);
            _dbContext.SaveChanges();
        }
예제 #3
0
 private void SetPath(ContentPathCacheEntry cacheEntry, ContentPath path)
 {
     SetPath(cacheEntry, path.ToString());
 }
예제 #4
0
        private IQueryable<ContentPathCacheEntry> GetEntryByPathQuery(ContentPath path)
        {
            var pathString = path.ToString();
            var pathHash = KnuthHash.CalculateHash(pathString);

            var pathCacheEntryQuery = ContentPathCacheEntries
                .Where(e => e.Hash == pathHash && e.Path == pathString);
            return pathCacheEntryQuery;
        }
예제 #5
0
        void IContentPathCache.UpdatePath(ContentPath oldPath, ContentPath newPath)
        {
            if (oldPath == null)
            {
                throw new ArgumentNullException("oldPath");
            }

            if (newPath == null)
            {
                throw new ArgumentNullException("newPath");
            }

            var cacheEntry = GetEntryByPath(oldPath);
            UpdatePathRecursive(oldPath.ToString(), newPath.ToString(), cacheEntry);
            _dbContext.SaveChanges();
        }
예제 #6
0
 private void SetPath(ContentPathCacheEntry cacheEntry, ContentPath path)
 {
     SetPath(cacheEntry, path.ToString());
 }