public async Task <IActionResult> PutMovies(int id, MoviesModel Movies) { if (id != Movies.ID) { return(BadRequest()); } _context.Entry(Movies).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MoviesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ViewingModel> > PostViewing([FromBody] ViewingModel Viewing) { _context.Viewing.Add(Viewing); await _context.SaveChangesAsync(); return(CreatedAtAction("GetViewing", new { id = Viewing.ID }, Viewing)); }