Ejemplo n.º 1
0
        public EvolutionDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <EvolutionDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            EvolutionDbContextConfigurer.Configure(builder, configuration.GetConnectionString(EvolutionConsts.ConnectionStringName));

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