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