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