Exemplo n.º 1
0
        public Dashboard_OxygenWebDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <Dashboard_OxygenWebDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            Dashboard_OxygenWebDbContextConfigurer.Configure(builder, configuration.GetConnectionString(Dashboard_OxygenWebConsts.ConnectionStringName));

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