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

            FilmPanelDbContextConfigurer.Configure(builder, configuration.GetConnectionString(FilmPanelConsts.ConnectionStringName));

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