Example #1
0
        public PersonalEvaluationDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <PersonalEvaluationDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            PersonalEvaluationDbContextConfigurer.Configure(builder, configuration.GetConnectionString(PersonalEvaluationConsts.ConnectionStringName));

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