Hi,
I'm writing a database wrapper to time how long it takes to return and iterate through a datareader.
I don't want to duplicate code, so within my data access class I'd ideally like to detect when the reader is being closed, and when it is stop the timer and log.
But a datareader will keep an open connection to the calling code, and when it is closed in that tier the connection will close. I don't want to put the stop time there, as that would be just verbose.
I've thought of inheriting IDataReader and having my own custom IDisposable / Close event, but was trying to think of something a bit simpler...
Thanks
I'm writing a database wrapper to time how long it takes to return and iterate through a datareader.
I don't want to duplicate code, so within my data access class I'd ideally like to detect when the reader is being closed, and when it is stop the timer and log.
But a datareader will keep an open connection to the calling code, and when it is closed in that tier the connection will close. I don't want to put the stop time there, as that would be just verbose.
I've thought of inheriting IDataReader and having my own custom IDisposable / Close event, but was trying to think of something a bit simpler...
Thanks