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