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