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

            TheEndProjectDbContextConfigurer.Configure(builder, configuration.GetConnectionString(TheEndProjectConsts.ConnectionStringName));

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