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