Exemplo 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));
        }
Exemplo 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);
             }
         });
     }
 }