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