title: Get Action from Task in C#
body: <p>Having instantiated one or more <code>Task</code> objects in C#, like this for example:</p>
  
  <pre><code>var tasks = new List&lt;Task&gt;
  {
      Task.Factory.StartNew(MyWorker.DoWork),
      Task.Factory.StartNew(AnotherWorker.DoOtherWork)
  };
  </code></pre>
  
  <p>Is there a way to get the <code>Action</code> method from the task object? In other words, can I return the <code>Action</code> of <code>MyWorker.DoWork</code> from its task?</p>
  
  <p>I'm trying to be able to log the status of each task, like this:</p>
  
  <pre><code>Task.WaitAll(tasks.ToArray(), new TimeSpan(0, 0, 1));
  
  var msg = tasks.Aggregate(string.Empty,
      (current, task) =&gt;
          current + $"{task.Action}: {task.Status}{Environment.NewLine}");
  </code></pre>
  
  <p>The string value of <code>msg</code> would be:</p>
  
  <pre><code>MyWorker.DoWork RanToCompletion
  AnotherWorker.DoOtherWork Running
  </code></pre>
  
  <p>(The <code>{task.Action}</code> portion of my sample doesn't exist and wouldn't compile, of course)</p>