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