How to check if a class implements an interface?
For example, I want to include an if that checks whether an object is of type IDisposable. How to do?
I tried something like:
MinhaClasse meuObjeto = new MinhaClasse();
if (typeof(meuObjeto) == IDisposable)
{
}
But it did not roll.