public ActionResult Edit([Bind(Include = "Id,Nom,Degats")] Arme arme) { if (ModelState.IsValid && ArmeValidator.Validate(arme, ModelState, db)) { db.Entry(arme).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(arme)); }
public ActionResult Create([Bind(Include = "Id,Nom,Degats")] Arme arme) { if (ModelState.IsValid && ArmeValidator.Validate(arme, ModelState, db)) { db.Armes.Add(arme); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(arme)); }