public void UpdateMovieGenre(int id, MovieGenre updatedMovieGenre) { var movieGenre = MovieGenres.SingleOrDefault(x => x.Id == id); if (movieGenre != null) { movieGenre.Name = updatedMovieGenre.Name; } this.SaveChanges(); }
public void DeleteMovieGenre(int id) { var movieGenre = MovieGenres.SingleOrDefault(x => x.Id == id); if (movieGenre != null) { MovieGenres.Remove(movieGenre); } this.SaveChanges(); }