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