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