title: How can I use an expression tree to call a generic method when the Type is only known at runtime?
body: <p>This is something that I solved using reflection, but would like to see how to do it using expression trees.</p>
  
  <p>I have a generic function:</p>
  
  <pre><code>private void DoSomeThing&lt;T&gt;( param object[] args ) {
      // Some work is done here.
  }
  </code></pre>
  
  <p>that I need to call from else where in my class.  Now, normally, this would be be simple:</p>
  
  <pre><code>DoSomeThing&lt;int&gt;( blah );
  </code></pre>
  
  <p>but only if I know, at design time that I am working with an <code>int</code>.  When I do not know the type until runtime is where I need the help.  Like I said, I know how to do it via reflection, but I would like to do it via expression trees, as my (very limited) understanding is that I can do so.</p>
  
  <p>Any suggestions or points to sites where I can get this understanding, preferably with sample code?</p>