title: IActionResult vs ObjectResult vs JsonResult in ASP.NET Core API
body: <p>What's the best option to use in a Web API that will return both <code>HTTP status codes</code> and <code>JSON</code> results?</p>
  
  <p>I've always used <code>IActionResult</code> but it was always a Web App with a Web API. This time it's <strong>only Web API</strong>.</p>
  
  <p>I have the following simple method that's giving me an error that reads:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type Microsoft.AspNetCore.Mvc.OkObjectResult
    to System.Threading.Tasks.Task Microsoft.AspNetCore.Mvc.IActionResult</p>
  </blockquote>
  
  <pre><code>[HttpGet]
  public Task&lt;IActionResult&gt; Get()
  {
     return Ok();
  }
  </code></pre>