public async Task <IActionResult> Edit(int id, [Bind("GenreId,Name")] Genre genre) { if (id != genre.GenreId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(genre); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GenreExists(genre.GenreId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(genre)); }
public async Task <IActionResult> Edit(int id, [Bind("SongId,AlbumId,SongName,ArtistName,Featuring,RunTimeSeconds")] 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("AlbumId,GenreId,Name,Artist,ReleaseDate")] Album album) { if (id != album.AlbumId) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(album); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AlbumExists(album.AlbumId)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(album); }