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

            DoubanJiangDbContextConfigurer.Configure(builder, configuration.GetConnectionString(DoubanJiangConsts.ConnectionStringName));

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