title: Passing a task as parameter
body: <p>I am not sure whether this is possible, so here me out:</p>
  
  <p>I have a sequence of action to perform multiple </p>
  
  <pre><code>async Task MethodA(...)
  {
      // some code
      // a call to specific Async IO bound method
      // some code
  }
  </code></pre>
  
  <p>there are also <code>MethodB()</code>, <code>MethodC()</code>, etc, and all of the have exactly the same code, except for the call to specific Async IO bound method. I am trying to find a way to pass a task pointer to a method, so that we can execute it later in a Method().</p>
  
  <p>What i am currently doing is this:</p>
  
  <pre><code>private async Task Method(Func&lt;Task&lt;Entity&gt;&gt; func)
  {
      // some code
      var a = await task.Run(func);
      // some code
  }
  
  var task = async () =&gt; await CallToIOBoundTask(params);
  Method(task);
  </code></pre>
  
  <p>This code, however, pulls a new thread each time, which is not required for IO bound task, and should be avoided.</p>
  
  <p>So, is there a way to refactor the code so that no ThreadPool thread is used? A goal is to have a code like this:</p>
  
  <pre><code>private async Task Method(Task&lt;Entity&gt; task)
  {
      // some code
      var a = await task;
      // some code
  }
  </code></pre>
  
  <p>It is also important to mention that different IO calls have different method signatures. Also, a task can start to execute only in <code>Method()</code> body, and not before.</p>