title: How to start a task that takes a parameter and returns a value?
body: <p>I'm trying to launch a task in C# that both takes a parameter and returns a value, but I can't seem to get the syntax right. </p>
  
  <p>Here's as close as I have gotten: here's a task that is expected to return an int. I'm my lambda, I'm also showing it taking a single parameter, o:</p>
  
  <pre><code>Task&lt;int&gt; task1 = Task.Factory.StartNew&lt;int&gt;((o) =&gt; { return 2 ; }, 3);
  Console.WriteLine(task1.Result);  // prints 2
  </code></pre>
  
  <p>The above line works (it returns a hardcoded value of 2, but you can see it's doing nothing with the parameter o, making it useless. If I do something with the parameter o, like this:</p>
  
  <pre><code>Task&lt;int&gt; task1 = Task.Factory.StartNew&lt;int&gt;((o) =&gt; { return (2 * o) ; }, 3);
  </code></pre>
  
  <p>I get a syntax message that Delegate 'System.Func' does not take 1 arguments. </p>
  
  <p>Any help on how to achieve both things (pass a parameter and retrieve a value) from a task would be great! </p>