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