public async Task <ActionResult <Episodes> > PutEpisodes(long id, Episodes episodes) { if (id != episodes.Id) { return(BadRequest()); } _context.Entry(episodes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EpisodesExists(id)) { return(NotFound()); } else { throw; } } return(episodes); }
public async Task <ActionResult <Podcast> > PutPodcast(long id, Podcast podcast) { if (id != podcast.Id) { return(BadRequest()); } _context.Entry(podcast).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PodcastExists(id)) { return(NotFound()); } else { throw; } } return(podcast); }
public async Task <ActionResult <Favorites> > PutFavorites(long id, Favorites favorite) { if (id != favorite.Id) { return(BadRequest()); } _context.Entry(favorite).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FavoriteExists(id)) { return(NotFound()); } else { throw; } } return(favorite); }
public async Task <IActionResult> PutUser(long id, User user) { if (id != user.Id) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }