public async Task <IActionResult> Edit(int id, [Bind("Id,Nom")] Vaccinator.Models.Vaccin vaccin) { if (id != vaccin.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vaccin); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategorieExists(vaccin.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vaccin)); }
public async Task <IActionResult> Create([Bind("Id,Nom")] Vaccinator.Models.Vaccin vaccin) { if (ModelState.IsValid) { _context.Add(vaccin); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vaccin)); }