コード例 #1
0
ファイル: CacheEntryStack.cs プロジェクト: gaufung/Extensions
        private CacheEntryStack(CacheEntryStack previous, CacheEntry entry)
        {
            if (previous == null)
            {
                throw new ArgumentNullException(nameof(previous));
            }

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

            var scopeLease = new ScopeLease(scopes);

            Scopes = scopes.Push(entry);

            return(scopeLease);
        }
コード例 #3
0
        private static CacheEntryStack GetOrCreateScopes()
        {
            CacheEntryStack scopes = Scopes;

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

            return(scopes);
        }
コード例 #4
0
 public ScopeLease(CacheEntryStack cacheEntryStack)
 {
     _cacheEntryStack = cacheEntryStack;
 }