Implementing a generic WeakReference<T> in C#
- đź“…
- đź“ť 384 words
- đź•™ 2 minutes
- 📦 .NET
- 🏷️ C#
- đź’¬ 4 responses
Check out the replacement EquatableWeakReference<T>
EquatableWeakReference<T> class
A weak reference lets you hold a reference to an object that will not prevent it from being garbage collected. There are a few scenarios where this might be important — such as listening for events, caching, various MVC patterns.