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