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