title: C# use async lambda expression with return bool in Enumerable.All extension
body: <p>I have the following <code>async</code> method</p>
  <pre><code>private async Task&lt;bool&gt; HasPolicy(AuthorizationFilterContext context, string policy)
  {
      var authorized = await _authorization.AuthorizeAsync(context.HttpContext.User, policy);
      return authorized.Succeeded;
  }
  </code></pre>
  <p>I would like to use it in <code>Enumerable.All</code> and <code>Enumerable.Any</code> extension</p>
  <pre><code>var result1 = IsAndPolicy
      ? policys.All(async x =&gt; await HasPolicy(context, x))
      : policys.Any(async x =&gt; await HasPolicy(context, x));
  </code></pre>
  <p>But the above code gets the following error</p>
  <blockquote>
  <p>Error  CS4010  Cannot convert async lambda expression to delegate type 'Func&lt;string, bool&gt;'. An async lambda expression may return void, Task or Task, none of which are convertible to 'Func&lt;string, bool&gt;'.</p>
  </blockquote>