I am using FileHelpers in one project, and the class MultiRecordEngine
public sealed class MultiRecordEngine : EventEngineBase<object>, IEnumerable, IDisposable This class implements IDisposable, BUT don't have a public Dispose method...
MultiRecordEngine eng = null; eng.Dispose(); // <---- Results in compilation error Inspecting this class code on GitHub I can see the method implemented explicitly here, line 913:
void IDisposable.Dispose() { Close(); GC.SuppressFinalize(this); } So... Why cannot I invoke the method? Is this intended, and if so, is it a good practice, and in what circumstances?
IDisposable(e.g.IEnumerator<T>) but theDisposemethod does nothing. Microsoft suggests that things with methods called e.g.Close,Shutdown, etc. may implementDisposeexplicitly to suggest that it's redundant with those other methods, but I really dislike that pattern since there's nothing to indicate what methods are adequate substitutes forDispose(some classes may keep resources afterCloseto allow for being re-opened).