title: No need to dispose DataContext/ObjectContext in EF?
body: <p>Albahari writes in "c# 4.0 in a nutshell":</p>
  
  <blockquote>
    <p>>
    Although DataContext/ObjectContext implement IDisposable, you can (in general)
    get away without disposing instances. Disposing forces the context’s connection
    to dispose—but this is usually unnecessary because L2S and EF close connections
    automatically whenever you finish retrieving results from a query
    &lt;&lt;</p>
  </blockquote>
  
  <p>This feels wrong and FxCop also complains if you are not diposing something that is IDisposable.</p>
  
  <p>I have the following repository code:</p>
  
  <pre><code>    public abstract class Repository&lt;TEntity&gt; : IRepository&lt;TEntity&gt; where TEntity : class
      { ...
          public void Add(TEntity entity)
      {
          using (var dbContext = this.UnityContainer.Resolve&lt;DbContext&gt;())
          {
              dbContext.Set&lt;TEntity&gt;().Add(entity);
              dbContext.SaveChanges();
          }
      }
  
      ...
  
      public virtual IEnumerable&lt;TEntity&gt; Find(Expression&lt;Func&lt;TEntity, bool&gt;&gt; expression)
      {
         using (var dbContext = this.UnityContainer.Resolve&lt;DbContext&gt;())
         {
             return dbContext.Set&lt;TEntity&gt;().Where(expression).ToList().AsEnumerable();
         }
      }
      ...
  </code></pre>
  
  <p>Note: I do not return IQueryable - lazy loading should not play a role.
  Resolve DbContext is configured as PerResolveLifetimeManager.</p>
  
  <p>Is this approach OK or do I need to reconsider this based on Albaharis description?</p>