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