title: Difference between Func<T, Task> and anonymous async await Action<T>
body: <p>I am developing on ASP.NET Core Blazor and sometimes I look on GitHub to learn something. This question isn't strictly related to Blazor, but I saw a lot of Blazor developers doing what I am going to explain.</p>
  
  <p>I noticed that some components accept an <code>Action&lt;T&gt;</code> as a parameter and others accept a <code>Func&lt;T, Task&gt;</code>. </p>
  
  <pre class="lang-cs prettyprint-override"><code>/* example */
  
  public class MyComponentA : ComponentBase 
  {
      [Parameter] public Action&lt;T&gt; OnClick {get; set;}
  
      //... other methods
  }
  
  public class MyComponentB : ComponentBase 
  {
      [Parameter] public Func&lt;T, Task&gt; OnClickAsync {get; set;}
  
      //... other methods
  }
  
  </code></pre>
  
  <p>What I understood is that you should bind <code>Action&lt;T&gt;</code> to a <strong>no-async/await</strong> method and <code>Func&lt;T, Task&gt;</code> to an <strong>async/method</strong>. So far so good.</p>
  
  <p>However, I see that someone is used to pass an <strong><em>async/await anonymous function</em></strong> as <code>Action&lt;T&gt;</code>, like <code>OnClick=@(async (item) =&gt; await Foo(item))</code>. Sometimes, I have passed an anonymous async/await function as <code>Action</code> too, and it works. </p>
  
  <ul>
  <li><p>Is it correct?</p></li>
  <li><p>Is there any kind of side effect?</p></li>
  <li><p>Is an <code>Action&lt;T&gt;</code> that invokes an anonymous async/await function, an asynchronous call?</p></li>
  </ul>