title: Using ThreadPool and Task.Wait inside an Async/Await Method
body: <p>I just encountered this code.  I immediately started cringing and talking to myself (not nice things).  The thing is I don't really understand why and can't reasonably articulate it.  It just looks really bad to me - maybe I'm wrong.</p>
  
  <pre><code>public async Task&lt;IHttpActionResult&gt; ProcessAsync()
  {
       var userName = Username.LogonName(User.Identity.Name);    
       var user = await _user.GetUserAsync(userName);
  
       ThreadPool.QueueUserWorkItem((arg) =&gt;
          {
              Task.Run(() =&gt; _billing.ProcessAsync(user)).Wait();
          });    
       return Ok();
  }
  </code></pre>
  
  <p>This code looks to me like it's needlessly creating threads with <code>ThreadPool.QueueUserWorkItem</code> and <code>Task.Run</code>.  Plus, it looks like it has the potential to deadlock or create serious resource issues when under heavy load.  Am I correct?  </p>
  
  <p>The _billing.ProcessAsync() method is <em>awaitable</em>(async), so I would expect that a simple "await" keyword would be the right thing to do and not all this other baggage.</p>