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

            ForwarderDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ForwarderConsts.ConnectionStringName));

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