public async Task <IActionResult> Edit(int id, [Bind("Id,Tytul,DataWydania,Gatunek,Cena,Ocena")] Film film) { if (id != film.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(film); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FilmExists(film.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(film)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,ReleaseDate,Genre,Price,Rating")] 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)); }