public async Task <IActionResult> Edit(int id, [Bind("ID,Omschrijving,Token,SerializedBord,AandeBeurt")] Spel spel) { if (id != spel.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(spel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpelExists(spel.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(spel)); }
public async Task <IActionResult> Edit(string id, [Bind("Token,SpelId,Id,UserName,Email,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] User user) { if (id != user.Id) { return(NotFound()); } if (ModelState.IsValid) { try { user.NormalizedEmail = user.Email.ToUpper(); user.NormalizedUserName = user.UserName.ToUpper(); _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SpelId"] = new SelectList(_context.Spel, "ID", "ID", user.SpelId); return(View(user)); }