Does foreach automatically call Dispose?

Yes, foreach will call Dispose() on the enumerator if it implements IDisposable.

Leave a Comment