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

            DiveCRMDbContextConfigurer.Configure(builder, configuration.GetConnectionString(DiveCRMConsts.ConnectionStringName));

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