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