public async Task <IActionResult> Edit(int id, [Bind("id,turma,periodo,idioma,sala,nivel,periodo_conclusao")] Turma turma) { if (id != turma.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(turma); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TurmaExists(turma.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(turma)); }
public async Task <IActionResult> Edit(int id, [Bind("id,cpf,nome,dataNascimento,telefone,email,ativo")] Aluno aluno) { if (id != aluno.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(aluno); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AlunoExists(aluno.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(aluno)); }