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

            AgileInsightsDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AgileInsightsConsts.ConnectionStringName));
            return(new AgileInsightsDbContext(builder.Options));
        }
예제 #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <AgileInsightsDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 AgileInsightsDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 AgileInsightsDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }