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

            TimePlayZeroDbContextConfigurer.Configure(builder, configuration.GetConnectionString(TimePlayZeroConsts.ConnectionStringName));

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