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