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