How to make one controller with a web API and not a web API on a single controller.
When I do this, I have a 404 error for a non-web API action.
I read in another article that you can mix with the ASP.NET core, but it doesn’t work.
Refund 404 for:
Or
Return 404 for http: // localhost: 5000 / api / board /
public class BoardController : Controller
{
private IDataContext dataContext;
public BoardController(IDataContext dataContext)
{
this.dataContext = dataContext;
}
public IActionResult Index(int boardID)
{
return View();
}
[HttpGet]
public IEnumerable<Board> GetAll()
{
}
}
I think I get the second solution and http: // localhost: 5000 / board / getall for the API action
source
share