public async Task <IActionResult> PutWatchList([FromRoute] int id, [FromBody] WatchList watchList) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != watchList.WatchId) { return(BadRequest()); } _context.Entry(watchList).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WatchListExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPopularMovies([FromRoute] int id, [FromBody] PopularMovies popularMovies) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != popularMovies.Id) { return(BadRequest()); } _context.Entry(popularMovies).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PopularMoviesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }