title: Specify lambda expression with Generics but having a templated type
body: <p>I have an interesting question for you all.</p>
  
  <pre class="lang-cs prettyprint-override"><code>public Func&lt;T, int&gt; GetLambdaFor&lt;T&gt;()
  {
     // ....
  }
  
  public void SetLambdaForAnyType(Func&lt;?, int&gt; lambda)
  {
     // ....
  }
  </code></pre>
  
  <p>In the code sample above I would like to find out if it is at all possible to specify a substitutable <code>Generic</code> <code>lambda expression</code> in <code>C#</code> using the SET method while retrieving a specifically typed <code>Generic</code> <code>lambda expression</code> using the GET method.</p>
  
  <p>So let me give an example (ofcourse it features broken <code>C#</code>, I would like to find out if it is possible and if so, how to do it):</p>
  
  <pre class="lang-cs prettyprint-override"><code>MyClass.SetLambdaForAnyType&lt;?&gt;((a) =&gt; new SomeValueGenerator&lt;?&gt;(a).GetValue());
  int generateValue = MyClass.GetLambdaFor&lt;string&gt;()("blah");
  generateValue = MyClass.GetLambdaFor&lt;DateTime&gt;()(DateTime.Now);
  // etc...
  </code></pre>
  
  <p>I hope it makes more sense now. Any ideas? If it is not possible, any alternative possibilities?</p>