title: Why does need implement Dispose pattern on UnitOfWork EF?
body: <p>The microsoft tutorial <a href="http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application" rel="nofollow">http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</a> advises to implement dispose pattern, like this:</p>
  
  <pre><code>private bool disposed = false;
  
          protected virtual void Dispose(bool disposing)
          {
              if (!this.disposed)
              {
                  if (disposing)
                  {
                      context.Dispose();
                  }
              }
              this.disposed = true;
          }
  
          public void Dispose()
          {
              Dispose(true);
              GC.SuppressFinalize(this);
          }
  </code></pre>
  
  <p>Why i should do it, why i cannot simply dispose context and enough, what happens if i will use only:</p>
  
  <pre><code>context.Dispose()
  </code></pre>
  
  <p>Which goals of implementation of Microsoft's dispose pattern?</p>