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

            PhonebookDbContextConfigurer.Configure(builder, configuration.GetConnectionString(PhonebookConsts.ConnectionStringName));

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