title: Getting return value from Task.Run
body: <p>I have the following code:</p>
  
  <pre><code>public static async Task&lt;string&gt; Start(IProgress&lt;ProcessTaskAsyncExProgress&gt; progress)
  {
      const int total = 10;
      for (var i = 0; i &lt;= total; i++)
      {
          await Task.Run(() =&gt; RunLongTask(i.ToString(CultureInfo.InvariantCulture)));
          if (progress != null)
          {
              var args = new ProcessTaskAsyncExProgress
              {
                  ProgressPercentage = (int)(i / (double)total * 100.0),
                  Text = "processing " + i
              };
              progress.Report(args);
          }
      }
      return "Done";
  }
  
  private static string RunLongTask(string taskName)
  {
      Task.Delay(300);
      return taskName + "Completed!";
  }
  </code></pre>
  
  <p>How do I get back the string value of <code>RunLongTask</code> from this line: <code>await Task.Run(() =&gt; RunLongTask(i.ToString(CultureInfo.InvariantCulture)));</code>?</p>
  
  <p>I've tried:</p>
  
  <pre><code>var val = await Task.Run(() =&gt; RunLongTask(i.ToString(CultureInfo.InvariantCulture))).Result;
  </code></pre>
  
  <p>But I get an error saying "string is not awaitable".</p>