Reputation: 1318
I have a class that contains a Dispose
method. In this method I abort a thread. Is it necessary to implement the IDisposable
interface?
Upvotes: 4
Views: 114
Reputation: 148120
If you implement IDisposable
interface then your class object could be used in using block that automatically call the Dispose
method implicitly.
From the answer from JaredPar
There are only 2 reasons for implementing IDisposable on a type
Is there any benefit to implementing IDisposable on classes which do not have resources?
Upvotes: 1