public async Task <ActionResult <TopRatedMovies1> > PostTopRatedMovies1Model(TopRatedMovies1 topRatedMovies1Model) { _context.topRatedMovies1.Add(topRatedMovies1Model); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTopRatedMovies1Model", new { id = topRatedMovies1Model.id }, topRatedMovies1Model)); }
public async Task <IActionResult> PutTopRatedMovies1Model(int id, TopRatedMovies1 topRatedMovies1Model) { if (id != topRatedMovies1Model.id) { return(BadRequest()); } _context.Entry(topRatedMovies1Model).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TopRatedMovies1ModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }