Beispiel #1
0
        public JiraDashboardDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <JiraDashboardDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            JiraDashboardDbContextConfigurer.Configure(builder, configuration.GetConnectionString(JiraDashboardConsts.ConnectionStringName));

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