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