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