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

            LearningAbpDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(LearningAbpDemoConsts.ConnectionStringName));

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