public async Task <IActionResult> Edit(int id, [Bind("Id,Title,ReleaseDate,Price")] Movie movie) { if (id != movie.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(movie); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MovieExists(movie.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(movie)); }
public async Task <IActionResult> Edit(int id, [Bind("movieID,category,title,year,director,rating,edited,lent,notes")] Movie movie) { if (id != movie.movieID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(movie); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MovieExists(movie.movieID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(movie)); }