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

            PhoneGamesDbContextConfigurer.Configure(builder, configuration.GetConnectionString(PhoneGamesConsts.ConnectionStringName));

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