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

            ABPEasyWebCreationDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ABPEasyWebCreationConsts.ConnectionStringName));

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