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