title: Is it possible to define a generic lambda in C#?
body: <p>I have some logic in a method that operates on a specified type and I'd like to create a generic lambda that encapsulates the logic. This is the spirit of what I'm trying to do:</p>
  
  <pre><code>public void DoSomething()
  {
      // ...
  
      Func&lt;T&gt; GetTypeName = () =&gt; T.GetType().Name;
  
      GetTypeName&lt;string&gt;();
      GetTypeName&lt;DateTime&gt;();
      GetTypeName&lt;int&gt;();
  
      // ...
  }
  </code></pre>
  
  <p>I know I can pass the type as a parameter or create a generic method. But I'm interested to know if a lambda can define its own generic parameters. (So I'm not looking for alternatives.) From what I can tell, C# 3.0 doesn't support this.</p>