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