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