title: Interface inheritance with IDisposable?
body: <p>I have the following inheritance hierarchy:</p>
  
  <pre><code>public interface IRepository&lt;T&gt; : IDisposable
  {
      void Add(T model);
      void Update(T model);
  
      int GetCount();
  
      T GetById(int id);
      ICollection&lt;T&gt; GetAll();
  }
  
  public interface IAddressRepository : IRepository&lt;Address&gt;
  {
  }
  </code></pre>
  
  <p>And this code:</p>
  
  <pre><code>var adrs = new Address[]{
      new Address{Name="Office"}
  };
  
  using (IAddressRepository adrr = new AddressRepository())
      foreach (var a in adrs)
          adrr.Add(a);
  </code></pre>
  
  <p>However, this code does not compile. It gives me this error message:</p>
  
  <pre><code>Error   43  
  'Interfaces.IAddressRepository': type used in a using statement must be
   implicitly convertible to 'System.IDisposable'
  </code></pre>
  
  <p>However, a parent of <code>IAddressRepository</code> inherits from <code>IDisposable</code>. </p>
  
  <p>What is happening here? How do I make the code compile?</p>