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