Пример #1
0
        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);
        }
Пример #2
0
 public bool Equals(WeakEntry <T>?other)
 {
     return(other != null && ReferenceEquals(other.Target, Target));
 }