public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] MsGenre msGenre) { if (id != msGenre.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(msGenre); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MsGenreExists(msGenre.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(msGenre)); }
public async Task <IActionResult> Create([Bind("Id,Name")] MsGenre msGenre) { if (ModelState.IsValid) { _context.Add(msGenre); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(msGenre)); }