public ActionResult Create(Offence offence) { if (ModelState.IsValid) { Db.Offences.Add(offence); Db.SaveChanges(); return RedirectToAction("Index"); } return View(offence); }
public ActionResult Edit(Offence offence) { if (ModelState.IsValid) { Db.Entry(offence).State = EntityState.Modified; Db.SaveChanges(); return RedirectToAction("Index"); } return View(offence); }