public async Task <IActionResult> Edit(int id, [Bind("PfeID,Titre,Mention,Note")] Pfe pfe) { if (id != pfe.PfeID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pfe); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PfeExists(pfe.PfeID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pfe)); }
public async Task <IActionResult> Create([Bind("PfeID,Titre,Mention,Note")] Pfe pfe) { if (ModelState.IsValid) { _context.Add(pfe); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pfe)); }