I want to use IDisposable interface to clean any resource from the memory, that is not being used.
public class dispose:IDisposable
{
public void Dispose()
{
throw new NotImplementedException();
}
public void fun()
{
PizzaFactory _pz = new PizzaFactory(); //
}
}
I want to dispose pz
object, when there is no ref to it exists. Please let me know how to do it.