public static void Initialize(MoviesWebAppDbContext context) { context.Database.Migrate(); UserSeed.Seed(context); MovieSeeds.Seed(context); ActorSeeds.Seed(context); ImgUrlSeed.Seed(context); ActorMovieSeeds.Seed(context); }
public static void Seed(MoviesWebAppDbContext context) { if (context.Actors.Any()) { return; } foreach (var Actor in GetInitialActors()) { context.Actors.Add(Actor); } context.SaveChanges(); }
public static void Seed(MoviesWebAppDbContext context) { if (context.Urls.Any()) { return; } foreach (var Url in GetInitialUrls()) { context.Add(Url); } context.SaveChanges(); }
public static void Seed(MoviesWebAppDbContext context) { if (context.Movies.Any()) { return; } foreach (var Movie in GetInitialMovies()) { context.Movies.Add(Movie); } context.SaveChanges(); }