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