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

            BankToolsDbContextConfigurer.Configure(builder, configuration.GetConnectionString(BankToolsConsts.ConnectionStringName));

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