Implement IDisposable on Enumerble to allow canceling a read.
Description
By putting a IDisposable.Dispose() on the Enumerables (EnumerableImpl?) you can allow for a "break;" in the foreach, and not keep the reader open.
A naive implementation, to demonstrate what I mean. public void Dispose() { _cmd.Cancel(); //canceling the command first prevents the reader from reading to the end. If reader.Close is called on an open ocmmand, it will continue to read all results that are left. _reader.Close(); }
By putting a IDisposable.Dispose() on the Enumerables (EnumerableImpl?) you can allow for a "break;" in the foreach, and not keep the reader open.
A naive implementation, to demonstrate what I mean.
public void Dispose()
{
_cmd.Cancel(); //canceling the command first prevents the reader from reading to the end. If reader.Close is called on an open ocmmand, it will continue to read all results that are left.
_reader.Close();
}
Suggested by Ingemar Lundberg in sourceforge thread: https://sourceforge.net/forum/forum.php?thread_id=1207753&forum_id=252014