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

            MediaShareDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MediaShareConsts.ConnectionStringName));

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