what is the purpose og a weak reference in c# code example
Example: c# week refrences
WeakReference foo = new WeakReference(new Foo());
((Foo)brokerRef.Target).Bar();
((Foo)brokerRef.Target).Baz();
GC.Collect();
GC.WaitForPendingFinalizers();
Assert.IsFalse(foo.IsAlive);