title: C# inheritance in generics question
body: <p>I have two interfaces:</p>
  
  <pre><code>public interface A { 
   void aMethod(); 
  }
  
  
  public interface B : A {
   void bMethod();
  } 
  </code></pre>
  
  <p>Later I'm basically using a dictionary like this:</p>
  
  <pre><code>Dictionary&lt;int, A&gt; dict = new Dictionary&lt;int, B&gt;();
  </code></pre>
  
  <p>C# is saying I can't convert from the right to the left, even if I cast it.  Is there a way to use generics in C# so that this can work? If I make them abstract classes it seems to be ok but I need these as interfaces.</p>