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