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