public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Description,Severity,Version,TrackDate")] BugModel bugModel) { if (id != bugModel.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bugModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BugModelExists(bugModel.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bugModel)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name")] SquasherModel squasherModel) { if (id != squasherModel.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(squasherModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SquasherModelExists(squasherModel.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(squasherModel)); }