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