public async Task <IActionResult> Edit(int id, [Bind("SongID,Title,Status,Contributor1Role,Contributor1,Contributor2Role,Contributor2,Contributor3Role,Contributor3")] Song song) { if (id != song.SongID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(song); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SongExists(song.SongID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(song)); }
public async Task <IActionResult> Edit(int id, [Bind("ApplicationUserID,Name,Role,Role2")] ApplicationUser applicationUser) { if (id != applicationUser.ApplicationUserID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(applicationUser); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplicationUserExists(applicationUser.ApplicationUserID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(applicationUser)); }