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