title: Cast Object to Generic List
body: <p>I have 3 generict type list.</p>
  
  <pre><code>List&lt;Contact&gt; = new List&lt;Contact&gt;();
  List&lt;Address&gt; = new List&lt;Address&gt;();
  List&lt;Document&gt; = new List&lt;Document&gt;();
  </code></pre>
  
  <p>And save it on a variable with type object. Now i nedd do Cast Back to List to perfom a foreach, some like this:</p>
  
  <pre><code>List&lt;Contact&gt; = (List&lt;Contact&gt;)obj;
  </code></pre>
  
  <p>But obj content change every time, and i have some like this:</p>
  
  <pre><code>List&lt;???&gt; = (List&lt;???&gt;)obj;
  </code></pre>
  
  <p>I have another variable holding current obj Type:</p>
  
  <pre><code>Type t = typeof(obj);
  </code></pre>
  
  <p>Can i do some thing like that??:</p>
  
  <pre><code>List&lt;t&gt; = (List&lt;t&gt;)obj;
  </code></pre>
  
  <p>Obs: I no the current type in the list but i need to cast , and i dont now another form instead: </p>
  
  <pre><code>List&lt;Contact&gt; = new List&lt;Contact&gt;();
  </code></pre>