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

            AgentPurchaseManagementPlatformDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AgentPurchaseManagementPlatformConsts.ConnectionStringName));

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