public ActionResult Create(Param param) { if (ModelState.IsValid) { db.Params.Add(param); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.MethodId = new SelectList(db.Methods, "Id", "MethodName", param.MethodId); return View(param); }
public ActionResult Edit(Param param) { if (ModelState.IsValid) { db.Entry(param).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.MethodId = new SelectList(db.Methods, "Id", "MethodName", param.MethodId); return View(param); }