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