// GET: Runs/Edit/5 public IActionResult Edit(int?id) { if (id == null) { return(HttpNotFound()); } GroupAndRun groupAndRun = new GroupAndRun(); groupAndRun.Run = _context.Run.Single(m => m.RunID == id); if (groupAndRun.Run == null) { return(HttpNotFound()); } groupAndRun.Group = _context.Group.Single(m => m.GroupID == groupAndRun.Run.GroupID); groupAndRun.Run.TestRunnerGroup = _context.TestRunnerGroup.SingleOrDefault (t => t.TestRunnerGroupID == groupAndRun.Run.TestRunnerGroupID); ViewBag.TestRunnerGroups = new SelectList(_context.TestRunnerGroup, "TestRunnerGroupID", "Name").ToList(); ViewBag.Groups = new SelectList(_context.Group, "GroupID", "Name", groupAndRun.Run.GroupID); return(View(groupAndRun)); }
// GET: Runs/Edit/5 public IActionResult Edit(int? id) { if (id == null) { return HttpNotFound(); } GroupAndRun groupAndRun = new GroupAndRun(); groupAndRun.Run = _context.Run.Single(m => m.RunID == id); if (groupAndRun.Run == null) { return HttpNotFound(); } groupAndRun.Group = _context.Group.Single(m => m.GroupID == groupAndRun.Run.GroupID); groupAndRun.Run.TestRunnerGroup = _context.TestRunnerGroup.SingleOrDefault (t => t.TestRunnerGroupID == groupAndRun.Run.TestRunnerGroupID); ViewBag.TestRunnerGroups = new SelectList(_context.TestRunnerGroup, "TestRunnerGroupID", "Name").ToList(); ViewBag.Groups = new SelectList(_context.Group, "GroupID", "Name", groupAndRun.Run.GroupID); return View(groupAndRun); }