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));
        }
Exemplo n.º 2
0
 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);
             }
         });
     }
 }