public async Task <IActionResult> Edit(int id, [Bind("Id,Line1,Line2,City,state,ZipCode")] Address addressModel) { if (id != addressModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(addressModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AddressExists(addressModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(addressModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Username,Email,Firstname,Lastname,ProfilePicture,Status")] Player playerModel) { if (id != playerModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(playerModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlayerExists(playerModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(playerModel)); }