public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Content")] Todo todo) { if (id != todo.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(todo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoExists(todo.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(todo)); }