title: On covariance and contravariance
body: <p>Scenario is</p>
  
  <pre><code>public interface IRow
  {
      int Id { get; set; }
      string Name { get; set; }
  }
  public class ARow : IRow
  { ... }
  public class BRow : IRow
  { ... }
  public class RowCollection&lt;T&gt; : Collection&lt;T&gt; where T : IRow
  {    }
  
  public interface ITable&lt;T&gt; where T : IRow
  {
      RowCollection&lt;T&gt; DataRows { get; }
      int Id { get; set; }
      string Name { get; set; }
  }
  
  public class ATable : ITable&lt;ARow&gt;
  {
      public RowCollection&lt;ARow&gt; DataRows
      {
          get;
          set;
      }
   }
  
  public class BTable : ITable&lt;BRow&gt;
  {
      public RowCollection&lt;BRow&gt; DataRows
      {
          get;
          set;
      }
   }
  </code></pre>
  
  <p>When i do something like this </p>
  
  <pre><code>        List&lt;ITable&lt;IRow&gt;&gt; lt = new List&lt;ITable&lt;IRow&gt;&gt;();
          ITable&lt;IRow&gt; ads = new ATable();
  </code></pre>
  
  <p>I get error, i know its something to do with covariance and contravariance if someone can help me overcome this error will be much appreciated.</p>
  
  <p>For sure i need to learn more on this topic but expecting a quick help on fixing this issue/scenario first.</p>
  
  <p>Regards,
  San</p>