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

            AgassizDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AgassizConsts.ConnectionStringName));

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