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