title: C# Lambda Functions: returning data
body: <p>Am I missing something or is it not possible to return a value from a lambda function such as..</p>
  
  <p><code>Object test = () =&gt; { return new Object(); };</code></p>
  
  <p>or</p>
  
  <p><code>string test = () =&gt; { return "hello"; };</code></p>
  
  <p>I get a build error "Cannot convert lambda expression to type 'string' because it is not a delegate type". </p>
  
  <p>It's like this syntax assigns the lambda rather than the result of the lambda, which I did not expect.
  I can achieve the desired functionality by assigning the function to a Func and calling it by name, but is that the only way?</p>
  
  <p>Please no "why would you need to do this?" regarding my example. </p>
  
  <p>Thanks in advance!</p>