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