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