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