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