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

            JIT_TXBOMDbContextConfigurer.ConfigureMySQL(builder, configuration.GetConnectionString(JIT_TXBOMConsts.ConnectionStringName));

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