Example #1
0
        private CacheEntryStack(CacheEntryStack previous, CacheEntry entry)
        {
            if (previous == null)
            {
                throw new ArgumentNullException(nameof(previous));
            }

            _previous = previous;
            _entry    = entry;
        }
Example #2
0
        internal static IDisposable EnterScope(CacheEntry entry)
        {
            CacheEntryStack scopes = GetOrCreateScopes();

            var scopeLease = new ScopeLease(scopes);

            Scopes = scopes.Push(entry);

            return(scopeLease);
        }
Example #3
0
        private static CacheEntryStack GetOrCreateScopes()
        {
            CacheEntryStack scopes = Scopes;

            if (scopes == null)
            {
                scopes = CacheEntryStack.Empty;
                Scopes = scopes;
            }

            return(scopes);
        }
 public ScopeLease(CacheEntryStack cacheEntryStack)
 {
     _cacheEntryStack = cacheEntryStack;
 }