title: How to execute async 'fire and forget' operation in ASP.NET Web API
body: <p>So, I have this Web API action, that executes an asynchronous function.</p>
  
  <pre><code>public void Post([FromBody]InsertRequest request)
  {
      InsertPostCommand.Execute(request);
      DoAsync();
  }
  
  private async void DoAsync()
  {
      await Task.Run(() =&gt;
      {
          //do async stuff here
      });
  }
  </code></pre>
  
  <p>I actually want the controller action to return to the client whilst the async operation executes.</p>
  
  <p>I did this and I am getting an exception thus:</p>
  
  <pre><code>System.InvalidOperationException: An asynchronous module or handler completed while an asynchronous operation was still pending.
  </code></pre>
  
  <p>How can I achieve this please ??</p>
  
  <p>Thanks</p>