public ReactTestDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <ReactTestDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            ReactTestDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ReactTestConsts.ConnectionStringName));

            return(new ReactTestDbContext(builder.Options));
        }
示例#2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <ReactTestDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 ReactTestDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 ReactTestDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }