"Jason MacKenzie" <jm**********************@formet.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have a class that does some database acess. I'm pretty meticulous in
closing all connections when done with them and disposing of all objects
that have a dispose method .
Does this class need to have a dispose method of its own? I'm a little
unclear on this?
The class must implement IDisposable just in case it aggregates a disposable
object.
If your class has a member variable of type IDbConnection, then yes, it
should implement IDisposable and IDisposable.Dispose should invoke
IDbConnection.Dispose.
If, on the other hand, your class uses IDbConnections objects only as local
variables inside its methods, then no, you don't need to implement
IDisposable.
David