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