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