title: Why does autofac double dispose my disposable?
body: <p>Hi this seems wrong to me. Is this the way it was designed?</p>
  
  <p>My disposable class:</p>
  
  <pre><code>class C : IDisposable
  {
      public void Dispose()
      {
          Console.WriteLine("Disposing C");
      }
  }
  </code></pre>
  
  <p>Registration:</p>
  
  <pre><code>cb.RegisterInstance(new C());
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>using (IContainer container = BuildContainer())
  {
      var c = container.Resolve&lt;C&gt;();
      Console.WriteLine("C resolved");
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>C resolved
  Disposing C
  Disposing C
  </code></pre>
  
  <p>I think its a bad thing to call Dispose multiple times on the same object.</p>
  
  <p>Note:
  When I register the class like this</p>
  
  <pre><code>cb.Register(c =&gt; new C());
  </code></pre>
  
  <p>It gets disposed only once. Why the difference?</p>