public void Attach(ref T key, THash associateWith) { if (associateWith == null || key == null) { return; } var weakRef = new WeakEntry <T>(key); key = null; _cache.TryAdd(IWeakCacheProvider <T, THash> .HashKey(associateWith), weakRef); }
public bool Equals(WeakEntry <T>?other) { return(other != null && ReferenceEquals(other.Target, Target)); }