public AccountingV03DbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <AccountingV03DbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            AccountingV03DbContextConfigurer.Configure(builder, configuration.GetConnectionString(AccountingV03Consts.ConnectionStringName));

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