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