title: How to create specific list type whose parameter is known at runtime and then loop through this list?
body: <p>I know I can create an object whose type is known only at run time like this:</p>
  
  <pre><code>Type t = record.GetType();
  var src = Activator.CreateInstance(t.BaseType);
  </code></pre>
  
  <ol>
  <li>How can I do something like <code>List&lt;Record&gt;=new List&lt;Record&gt;()</code> at run time?</li>
  <li><p>Suppose I am getting Child Record list using Reflection like this</p>
  
  <p><code>var ChildRecorList=src.GetType().GetProperty(propName).GetValue(src, null);</code></p></li>
  </ol>
  
  <p>and how can then I loop through this using <code>foreach</code> or <code>for</code> loop because <code>foreach</code> only works for known type list. It does now work with var types. Is there way to cast Reflection value to cast at specific type whose value is known at runtime(mentioned in point 1)</p>