Пример #1
0
        public JITDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <JITDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            JITDbContextConfigurer.Configure(builder, configuration.GetConnectionString(JITConsts.ConnectionStringName));

            return(new JITDbContext(builder.Options));
        }
Пример #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <JITDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 JITDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 JITDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }