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