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

            GameTicDbContextConfigurer.Configure(builder, configuration.GetConnectionString(GameTicConsts.ConnectionStringName));

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