public ActionResult Create(Release release) { if (ModelState.IsValid) { db.Releases.Add(release); db.SaveChanges(); return RedirectToAction("Manage", "Project", new { id = release.ProjectId }); } ViewBag.ProjectId = new SelectList(db.Projects, "ID", "Name", release.ProjectId); return View(release); }
public ActionResult Edit(Release release) { if (ModelState.IsValid) { db.Entry(release).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Details", "Project", new { id = release.ProjectId }); } ViewBag.ProjectId = new SelectList(db.Projects, "ID", "Name", release.ProjectId); return View(release); }