public async Task <IActionResult> Edit(int id, [Bind("IdClasse,Libelle,FiliereIdFiliere")] Model.Classe Classe) { if (id != Classe.IdClasse) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(Classe); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClasseExists(Classe.IdClasse)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(Classe)); }
public async Task <IActionResult> Create([Bind("Libelle,FiliereIdFiliere")] Model.Classe Classe) { if (ModelState.IsValid) { _context.Add(Classe); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(Classe)); }