title: C#, Iterating over a common parent class for generic children
body: <p>How would I setup the following classes so that I could have a method that takes a common parent class/interface and allow me to iterate over any child without specifying the generic Type?</p>
  
  <pre><code>public abstract class BaseClass
  { ??? }
  
  public class ChildClass&lt;T&gt; : BaseClass 
  {
      public List&lt;T&gt; SomeList;
              ???
  }
  
  ChildClass&lt;int&gt; childA = new ChildClass&lt;int&gt; ();
  ChildClass&lt;string&gt; childB = new ChildClass&lt;string&gt; ();
  
  public void IterateOverChild (BaseClass someChildClass)
  {
      foreach (var element in someChildClass.SomeList)    
      {
          Console.WriteLine (element);
      }
  
  }
  </code></pre>