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

            CalisetDbContextConfigurer.Configure(builder, configuration.GetConnectionString(CalisetConsts.ConnectionStringName));

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