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