Couple of day back I was reading an article by Jimmy Bogard Dependency Injection in ASP.NET MVC: Views. Over there I found an interesting thing that is correct usage of finalize and dispose. There are articles that discuss finalize, discuss and garbage collector. So, I will just give a small overview after the correct usage. correct usage is

public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (_disposed) return; /* This is where you should write the code to dispose your custom objects */ _disposed = true; }

How is this code gone help.This is how you should implement dispose, if you are interested in details like why then search for dispose and finalize in google and you will find explanations everywhere