I think the scaffolding may have changed as I am unable to build with the code for the POST method. It cannot find the GetTodoItem method which I assume is because this does not exist yet in the GET method. I am going to work forwards through the rest of the code and see if it fixes it.
My scaffolded code:
// GET: TodoItems
public async Task<IActionResult> Index()
{
return View(await _context.TodoItems.ToListAsync());
}
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I've been looking into this and it seems that the scaffolded controller inherits from Controller but in your code it inherits from Controller:Base. The scaffolded controller I have also scaffolds views which I believe I should not have.
I managed to get my POST working by removing all the views and commenting out other methods for now. After doing some digging - It looks like the scaffolded controller in .NET Core has to use the MVC approach with views. I believe your tutorial must use the scaffolding from .NET or perhaps an old scaffolding.
The tutorial works. I'm not sure what step you missed. You might try asking on StackOverflow,.