I'm using a class that extends ClientBase<>:
interface IService {}
class MyServiceClient : ClientBase<IService> {}
The issue I run into is that FxCop complains that a class with MyServiceClient as a member variable should also implement IDisposable and dispose of MyServiceClient.
ClientBase has an explicit implementation of Dispose(), which means a simple MyServiceClient.Dispose() doesn't compile. I have to explicitly cast to IDisposable. Why is that? Is it a signal that I shouldn't use Dispose()? Should I use Close() instead?
In Close and Dispose - which to call? is suggested that Close and Dispose should have the same implementation. Here is an example wrapper class (usage) which calls Close in the Dispose function. So it seems fine to call Close.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With