public async Task <IActionResult> Edit(int id, [Bind("Id,Title,ReleaseDate,Genre,Price,Rating")] Movice movice) { if (id != movice.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(movice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MoviceExists(movice.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(movice)); }
public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Genre,Price,Rating")] Movice movice) { if (ModelState.IsValid) { _context.Add(movice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(movice)); }