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