title: Async Task how to return value back from a method
body: <pre><code>CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
  
  Task tasks = PeriodicTaskFactory.Start(() =&gt; LongRunningOperation(), intervalInMilliseconds: 1000, synchronous: false, cancelToken: cancellationTokenSource.Token);
  
  int taskId = Task.WaitAny(tasks);
  </code></pre>
  
  <p>and my LongRunningOperation</p>
  
  <pre><code>private String LongRunningOperation()
  {
  ...
  return proj.Name;
  }
  </code></pre>
  
  <p>but the problem is how to get value from <code>LongRunningOperation</code> method back in <code>Task</code>. Method <code>tasks.Results</code> not exists. And I want to get back the value from each Task.</p>
  
  <p>I get PeriodicTaskFactory class from here</p>
  
  <p><a href="https://stackoverflow.com/questions/4890915/is-there-a-task-based-replacement-for-system-threading-timer">Is there a Task based replacement for System.Threading.Timer?</a></p>
  
  <p>Thank you</p>