title: ASP.NET Core Task<IActionResult> cannot return NotFound() and OK() without async
body: <p>This function gives an error:</p>
  <pre><code>[HttpPost]
  public Task&lt;IActionResult&gt; Something (string value)
  {
       Student student = new Student();
       if (value == &quot;LOW&quot;)
       {
           return NotFound();
       }
  
       return Ok();
  }
  </code></pre>
  <p>This function works fine:</p>
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; Something (string value)
  {
       Student student = new Student();
       if (value == &quot;LOW&quot;)
       {
           return NotFound();
       }
       return Ok();
  }
  </code></pre>
  <p>When I am trying to <code>return NotFound();</code> or <code>return Ok();</code> when I am not including keyword <code>asnyc</code> before <code>Task</code> as shown above, it gives me error. However, when i added the <code>async</code> keyword in front of <code>Task</code>, it does not shows any error in the compiler. Can you tell me what is causing this?</p>