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