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