public ActionResult Create(Issue issue) { if (ModelState.IsValid) { db.Issues.Add(issue); db.SaveChanges(); return RedirectToAction("Details", "Release", new { id = issue.ReleaseId }); } ViewBag.ReleaseId = new SelectList(db.Releases, "ID", "Name", issue.ReleaseId); return View(issue); }
public ActionResult Edit(Issue issue) { if (ModelState.IsValid) { db.Entry(issue).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Details", "Release", new { id = issue.ReleaseId }); } ViewBag.ReleaseId = new SelectList(db.Releases, "ID", "Name", issue.ReleaseId); return View(issue); }