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