title: async lambda expression with arguments
body: <p>I am trying to call my async function from a wrapper. But I am getting this compiler error. In the following code, I would like to get <code>string x</code> value with most of awaits abstracted/pushed into <code>CallAsyncFunc</code> code. What is the right way to do this in c# 4.5? Thanks!</p>
  
  <blockquote>
    <p>error CS4010: Cannot convert async lambda expression to delegate type
     '<code>System.Func&lt;int,string&gt;</code>'. An async lambda expression may return <code>void</code>,
     <code>Task</code> or <code>Task&lt;T&gt;</code>, none of which are convertible to
     '<code>System.Func&lt;int,string&gt;</code>'.</p>
  </blockquote>
  
  <pre><code>public async Task&lt;T2&gt; CallAsyncFunc&lt;T1,T2&gt;(T1 a, Func&lt;T1, T2&gt; func)
  {
      return func.Invoke(a);
  }
  
  public async Task&lt;string&gt; GetString(int value)
  {
      await Task.Run(() =&gt; Thread.Sleep(2000));
      return "" + value;
  }
  
  public async Task MainAsyncEntry()
  {
      string x = await CallAsyncFunc&lt;int, string&gt;(30, async(x) =&gt; await GetString(x));
  }
  </code></pre>