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