Пример #1
0
        public EleccionesDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <EleccionesDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            EleccionesDbContextConfigurer.Configure(builder, configuration.GetConnectionString(EleccionesConsts.ConnectionStringName));

            return(new EleccionesDbContext(builder.Options));
        }
Пример #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <EleccionesDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 EleccionesDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 EleccionesDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }