There are a lot of question discussing the “patterned” was of implementing and using IDisposable/Dispose, but what advantage does it have over having all the cleanup code in C# class finilizer?
Sure other classes can explicitly call Dispose earlier than the class instance is garbage collected and the finilizer is called. Is it the only one?
You have no guarantees about when or even if a Finalizer (destructor) will be called.
So in order to timely cleanup resources (Files, Db Connections) the Dispose pattern is essential.