I am trying to implement a iDisposable class and I saw a code like that
public class Foo: IDisposable 
{
    public void Dispose()
    {
        // Does Something.
    }
    ~Foo()
    {
    }
}
what does ~Foo()?
I am trying to implement a iDisposable class and I saw a code like that
public class Foo: IDisposable 
{
    public void Dispose()
    {
        // Does Something.
    }
    ~Foo()
    {
    }
}
what does ~Foo()?
 
    
    Take a look at the Msdn, it has a really good and simple example what a destructor does http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx
It is a Finalizer and its purpose is to clean up any unmanaged resources the class holds. There is a whole lot of information to learn about what Finalizers are for and how they work.
