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