public async Task<IActionResult> Edit(Movie movie) { if (ModelState.IsValid) { context.Update(movie); await context.SaveChangesAsync(); return RedirectToAction("Index"); } return View(movie); }
public async Task<IActionResult> Create(Movie movie) { if (ModelState.IsValid) { movie.Id = Guid.NewGuid(); context.Movies.Add(movie); await context.SaveChangesAsync(); return RedirectToAction("Index"); } return View(movie); }