title: Conversion of synchronous methods with Action/Func parameters to asynchronous
body: <p>I've looked around and can't find this question asked anywhere.</p>
  
  <p>Given the following method: </p>
  
  <pre><code>public TOut WithThing&lt;TOut&gt;(Func&lt;T, TOut&gt; func)
  {
    var thing = CreateThing();
    thing.DoSomething();
    return func(thing);
  }
  </code></pre>
  
  <p>I have an equivalent <code>void</code> method which wraps the above for when I don't want to return a value (it's calling <code>WithThing&lt;bool&gt;</code> really and just discarding the result):</p>
  
  <pre><code>public void WithThing(Action&lt;T&gt; action)
  {
    WithThing(x =&gt;
    {
      action(x);
      return false;
    });
  }
  </code></pre>
  
  <p>I'm trying to create asynchronous versions of the above methods because "Thing" has synchronous and asynchronous methods.</p>
  
  <p>I <em>think</em> the equivalent of the first method is:</p>
  
  <pre><code>public async Task&lt;TOut&gt; WithThing&lt;TOut&gt;(Func&lt;T, Task&lt;TOut&gt;&gt; func)
  {
    var thing = CreateThing();
    await thing.DoSomethingAsync().ConfigureAwait(false);
    return await func(thing).ConfigureAwait(false);
  }
  </code></pre>
  
  <p>I didn't think I'd need the <code>ConfigureAwait</code>'s but Visual Studio is suggesting them. Is this correct? Why do I need the <code>ConfigureAwait</code>'s?</p>
  
  <p>If the above code is correct, then I'd guess the signature for the equivalent that doesn't return a value would be <code>public async Task WithThing(Func&lt;T, Task&gt; func)</code>. What would the body be?</p>