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