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