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