public TestingAngularDbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder <TestingAngularDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); TestingAngularDbContextConfigurer.Configure(builder, configuration.GetConnectionString(TestingAngularConsts.ConnectionStringName)); return(new TestingAngularDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <TestingAngularDbContext>(options => { if (options.ExistingConnection != null) { TestingAngularDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { TestingAngularDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } }