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

            SolutionsDbContextConfigurer.Configure(builder, configuration.GetConnectionString(SolutionsConsts.ConnectionStringName));

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