public ActionResult Create(Method method) { if (ModelState.IsValid) { db.Methods.Add(method); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.RemoteWebServiceId = new SelectList(db.RemoteWebServices, "Id", "ServiceName", method.RemoteWebServiceId); return View(method); }
public ActionResult Edit(Method method) { if (ModelState.IsValid) { db.Entry(method).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.RemoteWebServiceId = new SelectList(db.RemoteWebServices, "Id", "ServiceName", method.RemoteWebServiceId); return View(method); }