public async Task <IActionResult> PutTodo(int id, Todos todo) { if (id != todo.Id) { return(BadRequest()); } _context.Entry(todo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }