Essentially, I have a DataTableReader
object and I was reviewing my code to make sure everything disposable was indeed disposed of.
DataTableReader
implements IDisposable
, but IntelliSense doesn't seem to be picking up on it:
It does however work with other disposable classes, such as FileStream
:
So, what gives? DataTableReader
IS disposable, right?
It's because the DbDataReader
's Dispose
method has the EditorBrowsableAttribute set to Never basically telling VS to not show it. Why? I am not sure.
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void Dispose() {
Dispose(true);
}
protected virtual void Dispose(bool disposing) {
if (disposing) {
Close();
}
}