private void RemoveFirst() { // Remove from LRUPriority LinkedListNode <CacheItem> node = _lruList.First; _lruList.RemoveFirst(); // Remove from cache _cacheMap.Remove(node.Value.Key); // Notify of event removed CacheItemRemoved?.Invoke(node.Value); }
protected virtual void OnCacheItemRemoved(CacheItemRemovedEventArgs args) { CacheItemRemoved?.Invoke(this, args); }