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