private CacheEntryStack(CacheEntryStack previous, CacheEntry entry) { if (previous == null) { throw new ArgumentNullException(nameof(previous)); } _previous = previous; _entry = entry; }
internal static IDisposable EnterScope(CacheEntry entry) { CacheEntryStack scopes = GetOrCreateScopes(); var scopeLease = new ScopeLease(scopes); Scopes = scopes.Push(entry); return(scopeLease); }
private static CacheEntryStack GetOrCreateScopes() { CacheEntryStack scopes = Scopes; if (scopes == null) { scopes = CacheEntryStack.Empty; Scopes = scopes; } return(scopes); }
public ScopeLease(CacheEntryStack cacheEntryStack) { _cacheEntryStack = cacheEntryStack; }