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