title: Casting an IEnumerable to IEnumerable<T> with reflection
body: <p>So, I need to call a third party method, that has a signature like this</p>
  
  <p><code>ThirdPartyMethod&lt;T&gt;(IEnumerable&lt;T&gt; items)</code></p>
  
  <p>My problem is I don't know the type of my object at compile time.</p>
  
  <p>At compile time I have this</p>
  
  <pre><code>IEnumerable myObject;
  Type typeOfEnumerableIHave;
  </code></pre>
  
  <p>Sooo..can reflection help me out here somehow?</p>
  
  <p>for simplicity sake, pretend I have a method like this</p>
  
  <pre><code>void DoWork(IEnumerable items, Type type)
  {
     //In here I have to call ThirdPartyMethod&lt;T&gt;(IEnumerable&lt;T&gt; items);
  }
  </code></pre>