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

            Test1DbContextConfigurer.Configure(builder, configuration.GetConnectionString(Test1Consts.ConnectionStringName));

            return(new Test1DbContext(builder.Options));
        }
Exemplo n.º 2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <Test1DbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 Test1DbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 Test1DbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }