Singleton implementation of Cache Dependency Manager
As CacheDependencyManager is a singleton it should be thread safe.

ConcurrentDictionary is a nice fit for this.

Using ConcurrentDictionarythe code would look like this:

private ConcurrentDictionary&lt;string, ExplicitCacheDependency&gt; _dependencies = new ConcurrentDictionary&lt;string, ExplicitCacheDependency&gt;();

public CacheDependency GetCacheDependency(string key)
{
    return _dependencies.GetOrAdd(key, k =&gt; new ExplicitCacheDependency(k));
}

public void InvalidateDependency(string key)
{
    ExplicitCacheDependency dependency;
    if (_dependencies.TryRemove(key, out dependency))
    {
        dependency.Invalidate();
        dependency.Dispose();
    }
}