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()); }
public async Task <IActionResult> PutGenre(int id, Genre genre) { if (id != genre.GenreId) { return(BadRequest()); } _context.Entry(genre).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GenreExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCategory(int id, Category category) { if (id != category.Id) { return(BadRequest()); } _context.Entry(category).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutActor(int id, Actor actor) { if (id != actor.ActorId) { return(BadRequest()); } _context.Entry(actor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ActorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }