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

            AmmStewDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AmmStewConsts.ConnectionStringName));

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