title: How to pass Expression<Func<int>> to a function
body: <p>Assume the following programm:</p>
  
  <pre class="lang-cs prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Linq.Expressions;
  
  namespace Lambda {
      class Program {
          public void TheFunction&lt;T&gt; (Expression&lt;Func&lt;T&gt;&gt; action) { 
          /** logic **/
          }
  
          static void Main (string[] args) {    
              TheFunction(); //this will of course not compile,
                             // because the Lambda Expression is missing. 
          }
      }
  
      public class foo {
          public int bar { get; set; }
      }
  }
  </code></pre>
  
  <p>The Question here is how to call TheFunction? The Goal is to Work with the Expression> in order to retrieve the Property name besides other things, within TheFunction.</p>
  
  <p>I would like to have something like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>//...
  TheFunction((foo f)=&gt; f.bar);
  //...
  </code></pre>
  
  <p>But when i try it will say, that the type arguments cannot be infered from the usage and i should try to specify them, but how?</p>