title: How to access to Task argument?
body: <p>Suppose I have a <code>List&lt;Task&gt;</code>:</p>
  
  <pre><code>private readonly List&lt;Task&gt; _tasks = new List&lt;Task&gt;(new Task[9]);
  </code></pre>
  
  <p>I want create a <code>Task</code> for start the <code>DoWorkAsync</code> method available inside the class <code>Foo</code>, so what I did is the following:</p>
  
  <pre><code>_tasks[0] = new Task&lt;Foo&gt;(() =&gt; new Foo().DoWorkAsync());
  </code></pre>
  
  <p>so the <code>Foo</code> class contains <code>DoWorkAsync</code> method which have a design similar to this:</p>
  
  <pre><code>public async Task HeavyAsync()
  {
      while (true)
      {
          string newData = DateTime.Now.ToLongTimeString();
          Console.WriteLine(newData);
          await Task.Delay(200);
      }
  }
  </code></pre>
  
  <p>actually I can start the <code>Task</code> using <code>_tasks[0].Start();</code>.</p>
  
  <p>This works, but the main problem is that I want access to the public property of <code>Foo</code> class and I can't, because when I type this: <code>_tasks[0].</code></p>
  
  <p>I'll get the following method:</p>
  
  <p><a href="https://i.stack.imgur.com/Xf08Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xf08Z.png" alt="enter image description here"></a></p>
  
  <p>I also tried using <code>GetAwaiter()</code> and <code>await</code>:</p>
  
  <pre><code>var foo = await _tasks[0];
  </code></pre>
  
  <p>but I'll get the following error:</p>
  
  <blockquote>
    <p>Cannot assign void to an implicitly-typed local variable</p>
  </blockquote>
  
  <p>How can I access to the <code>Foo</code> properties?</p>