public async Task <ActionResult <FilmsGenres> > PostFilmsGenres(FilmsGenres filmsGenres) { _context.FilmsGenres.Add(filmsGenres); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFilmsGenres", new { id = filmsGenres.FilmsGenresId }, filmsGenres)); }
public async Task <IActionResult> PutFilmsGenres(int id, FilmsGenres filmsGenres) { if (id != filmsGenres.FilmsGenresId) { return(BadRequest()); } _context.Entry(filmsGenres).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FilmsGenresExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }