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