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

            CoreSignalRTestDbContextConfigurer.Configure(builder, configuration.GetConnectionString(CoreSignalRTestConsts.ConnectionStringName));

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