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

            BulletRayDbContextConfigurer.Configure(builder, configuration.GetConnectionString(BulletRayConsts.ConnectionStringName));

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