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