title: Create a Generic IEnumerable<T> given a IEnumerable and the member datatypes
body: <p>I get an IEnumerable which I know is a object array. I also know the datatype of the elements. Now I need to cast this to an IEnumerable<code>&lt;T</code>>, where T is a supplied type. For instance</p>
  
  <pre><code>IEnumerable results = GetUsers();
  Type t = GetType(); //Say this returns User
  IEnumerable&lt;T&gt; users = ConvertToTypedIEnumerable(results, t);
  </code></pre>
  
  <p>I now want to cast/ convert this to IEnumerable<code>&lt;User</code>>. Also, I want to be able to do this for any type. </p>
  
  <p>I cannot use IEnumerable.Cast&lt;>, because for that I have to know the type to cast it to at compile time, which I don't have. I get the type and the IEnumerable at runtime.</p>
  
  <p>-
  Thanks</p>