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