The other day I got a code review comment saying that I should implement the full blown disposable pattern for IDisposable including the protected virtual void Dispose(bool disposing) method. For a long time I had implemented the IDisposable without caring about the additional overload - and I started worrying how many bugs I’ve introduced by not doing so.
The pattern The most recent official documentation I could find describes the pattern in details, which I’ll summarize below.
Today I was reviewing a colleague’s code and I saw a pattern similar to the one below: