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

            AbpVuenetcoreDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AbpVuenetcoreConsts.ConnectionStringName));

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