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