public async Task <IActionResult> Edit(int id, [Bind("Id,Divname")] Division division) { if (id != division.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(division); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DivisionExists(division.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(division)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Abbrev,Fullname, Building")] Team team) { if (id != team.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(team); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TeamExists(team.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(team)); }