Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 public void Configure(EntityTypeBuilder <People> builder)
 {
     builder.HasKey(p => p.Id);
     builder.HasIndex(p => p.Name).IsUnique();
     builder.HasData(PeopleSeed.Seed());
 }