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