private static void Seed(VideoStoreDbContext context) { context.Genres.AddRange(GenreSeed.Seed()); context.Person.AddRange(PeopleSeed.Seed()); context.ProductionCompanies.AddRange(ProductionCompanySeed.Seed()); context.Movies.AddRange(MovieSeed.Seed()); context.MovieGenre.AddRange(MovieGenreSeed.Seed()); context.MovieActor.AddRange(MovieActorSeed.Seed()); context.MovieDirector.AddRange(MovieDirectorSeed.Seed()); context.MovieProductionCompany.AddRange(MovieProductionCompanySeed.Seed()); context.SaveChanges(); }
public void Configure(EntityTypeBuilder <MovieProductionCompany> builder) { builder.HasKey(p => new { p.MovieId, p.ProductionCompanyId }); builder.HasData(MovieProductionCompanySeed.Seed()); }