public ActionResult Create(Castle castle) { if (ModelState.IsValid) { db.Castles.Add(castle); db.SaveChanges(); return RedirectToAction("Index"); } return View(castle); }
public ActionResult Edit(Castle castle) { if (ModelState.IsValid) { db.Entry(castle).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(castle); }