title: How to add parameters to an async function action parameter in c#
body: <p>I have the method below</p>
  <pre><code>protected async Task ProcessExecuteResponseAsync(string errorMessage, 
              Func&lt;Task&gt; failureAction = null)
  {
      if (isOk == false)
      {
          if (failureAction != null)
          {
              var failureResult = failureAction.Invoke();
              await failureResult;
          }
      }
  }
  </code></pre>
  <p>This works perfectly</p>
  <p>However, now I want to pass error message to the failureAction action</p>
  <p>What is the syntax for that?</p>
  <p>I tried</p>
  <pre><code>protected async Task ProcessExecuteResponseAsync(string errorMessage, 
              Func&lt;Task, string&gt; failureAction = null)
  {
      if (isOk == false)
      {
          if (failureAction != null)
          {
              var failureResult = failureAction.Invoke(errorMessage);
              await failureResult;
          }
      }
  }
  </code></pre>
  <p>But I get error that string cannot be converted to Task</p>