title: How to return a view using ASP.NET Core API controller
body: <p>I am using ASP.NET core, which I have read has the controller and API merged as one. I have successfully managed to get the JSON data to work, however, the view is not working. It just says the page can not be found. I am able to view the home page, however, this is created as an MVC controller and not as an API controller.</p>
  <pre class="lang-cs prettyprint-override"><code>namespace ScheduleWebApp.Controllers
  {
      [Route(&quot;api/[controller]&quot;)]
      [ApiController]
      public class StaffHoursWorkedController : Controller
      {
          public IActionResult Index()
          {
              return View();
          }
      }
  }
  </code></pre>