public async Task <ActionResult <ArtistSongs> > PostArtistSongs(ArtistSongs artistSongs) { _context.ArtistSongs.Add(artistSongs); await _context.SaveChangesAsync(); return(CreatedAtAction("GetArtistSongs", new { id = artistSongs.Id }, artistSongs)); }
public async Task <IActionResult> PutArtistSongs(int id, ArtistSongs artistSongs) { if (id != artistSongs.Id) { return(BadRequest()); } _context.Entry(artistSongs).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ArtistSongsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }