title: Choosing not to await async function in action in ASP.NET Core WebAPI controller
body: <p>The scenario is the following: </p>
  
  <ul>
  <li>Backend: Asp.NET Core WebAPI 2.2</li>
  <li>Frontend: iOS and Android which consumes the API</li>
  </ul>
  
  <p>I have a function allowing the user to send messages to other users. The sending of a message is done in an asynchronous action:</p>
  
  <p><code>public async Task&lt;IActionResult&gt; CreateMessage</code></p>
  
  <p>This action does the following in order:</p>
  
  <ol>
  <li>Validation</li>
  <li>Awaits persistance of the message to DB</li>
  <li>Awaits the notification of relevant clients via SignalR</li>
  <li><strong>Doesn't await</strong> the sending of push notification via Azure Notification Hub.</li>
  <li>Returns a 200 OK.</li>
  </ol>
  
  <p>The last two lines in the action is the following:</p>
  
  <pre><code>_notificationHubProxy.SendNotification(messageToReturnResource.SenderName, messageToPush, recipientId);
  
  return Ok(messageToReturnResource);
  </code></pre>
  
  <p>SendNotification is asynchronous but I choose to not await it to avoid UI-locks caused by the waiting of the request to finish. At the moment all this seems to work fine.</p>
  
  <p>My question is really the following: is this okey (i.e. to not await), or is this an example of writing bad code which will cause problems when I have many clients using the application?</p>
  
  <p>Regards</p>