public async Task <IActionResult> Edit(int id, [Bind("Id,AssigneeId,IssueReporterId, Content,ReportedDate")] Issue issue) { if (id != issue.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(issue); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IssueExists(issue.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AssigneeId"] = new SelectList(_context.Assignee, "Id", "Id", issue.AssigneeId); ViewData["IssueReporterId"] = new SelectList(_context.Set <IssueReporter>(), "Id", "Id", issue.IssueReporterId); return(View(issue)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email")] IssueReporter issueReporter) { if (id != issueReporter.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(issueReporter); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IssueReporterExists(issueReporter.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(issueReporter)); }