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