public virtual void OneTimeSetUp() { Database.SetInitializer <TelimenaTelemetryContext>((IDatabaseInitializer <TelimenaTelemetryContext>) new DropCreateDatabaseAlwaysWithConnectionClose()); this.TelemetryContext.Database.Initialize(true); Database.SetInitializer <TelimenaPortalContext>((IDatabaseInitializer <TelimenaPortalContext>) new DropCreateDatabaseAlwaysWithConnectionClose()); this.PortalContext.Database.Initialize(true); TelimenaPortalDbInitializer.SeedUsers(this.PortalContext); this.SeedAction?.Invoke(); }
protected override void Seed(Telimena.WebApp.Infrastructure.Database.TelimenaPortalContext context) { // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. //protected override void Seed(TelimenaPortalContext portalContext) //{ TelimenaPortalDbInitializer.SeedUsers(context); TelimenaPortalDbInitializer.SeedToolkit(context); context.SaveChanges(); //} }