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