title: Async methods cannot have ref or out parameters
body: <p>I want to call email notification using <strong>asynchronously</strong></p>
  
  <pre><code>   public void UpdatePassDetailsForLostCase(LostPassRequest objLostPassRequest, out TransactionalInformation transaction)
      {
          transaction = new TransactionalInformation();
  
          try
          {
              _passDataService.UpdatePassDetailsForLostCase(objLostPassRequest);
  
              transaction.ReturnStatus = true;
              transaction.ReturnMessage.Add("Pass details updated successfully.");
          }
          catch (Exception ex)
          {
              transaction.ReturnMessage.Add(ex.Message);
              transaction.ReturnStatus = false;
          }
      }
  </code></pre>
  
  <p>This is what I have tried but it is giving me an error </p>
  
  <blockquote>
    <p>"Async methods cannot have ref or out parameters".</p>
  </blockquote>
  
  <pre><code>    public async void UpdatePassDetailsForLostCase(LostPassRequest objLostPassRequest, out TransactionalInformation transaction)
      {
          transaction = new TransactionalInformation();
  
          try
          {
              _passDataService.UpdatePassDetailsForLostCase(objLostPassRequest);
  
              await EmailNotificationAsync(1, "LostPass", "LostPass");
  
              transaction.ReturnStatus = true;
              transaction.ReturnMessage.Add("Pass details updated successfully.");
          }
          catch (Exception ex)
          {
              transaction.ReturnMessage.Add(ex.Message);
              transaction.ReturnStatus = false;
          }
      }
  
  Task&lt;int&gt; EmailNotificationAsync(string passId, string actionName, string moduleName)
      {
          return Task.Run&lt;int&gt;(() =&gt;
          {
              return EmailNotification(passId, actionName, moduleName);
          });
      }
  
   private int EmailNotification(string passId, string actionName, string moduleName)
      {
          try
          {
              //Email Send Code
          }
          catch (Exception ex)
          {
              InsertErrorLog(moduleName, "EmailNotification", ex.Message); // Add error in database.
          }
          return 1;
      }       
  </code></pre>
  
  <blockquote>
    <p>Give the error:</p>
    
    <p>Error CS1988 Async methods cannot have ref or out parameters </p>
  </blockquote>
  
  <p>How can I workaround this?</p>