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