Keeping Async Methods Alive
Consider a type that will print out a message when it’s finalized, and that has a Dispose method which will suppress finalization: class DisplayOnFinalize : IDisposable { public void Dispose() { GC.SuppressFinalize(this); } ~DisplayOnFinalize() { Console.WriteLine(“Finalized”); } } Now conside...