public ActionResult Edit(Car car) { if (ModelState.IsValid) { db.Entry(car).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(car); }
public ActionResult Create(Car car) { if (ModelState.IsValid) { car.Id = Guid.NewGuid(); db.Cars.Add(car); db.SaveChanges(); return RedirectToAction("Index"); } return View(car); }